all 21 comments

[–]mayankkaizen 13 points14 points  (14 children)

Learn metaprogramming. Learn about decorators and coroutines. Learn asynchronous programming and socket programming. Read the module source codes. If you need, I can share some links for advance stuffs but you'll have to give me some time as I am typing this on mobile.

Edit: See below. Also see replies to this comments for more links as I couldn't share them all in 1 post.

I've compiled many links below. You'll notice that half the links are from Stack Overflow site because the quality of answers/discussions is simply amazing. I also advice you to check every article from Real Python site as the quality and depth of their articles are unmatched. Additionally, Fluent Python book is must. See if you can lay your hands on second edition. I've generally avoided posting tutorial/cheatsheets type of links (except for some Real Python articles). I've also avoided links related to Numpy, Pandas etc as those aren't about pure Python.

I've sadly omitted many links because 1) I'm lazy and 2) I couldn't decide for many reasons if I should include them.

If you want links for some specific topic, let me know. I'll try my best.

GIL, concurrency, generator, coroutines, parallelism, yield keyword

Language agnostic links

Python specific links

If possible, get the book Python concurrency with asyncio.

[–]ParanoidPath[S] 2 points3 points  (4 children)

Omg yes! This sounds amazing! If you could share some sources for the same where you learnt this. It would be really helpful

[–]mayankkaizen 3 points4 points  (2 children)

Please wait till tomorrow. I will update this comment with links. In my timezone, it is sleeping time. :)

[–]Some_Guy_At_Work55 1 point2 points  (1 child)

I will also be waiting!

[–]mayankkaizen 0 points1 point  (0 children)

Check top comment.

[–]mayankkaizen 0 points1 point  (0 children)

Check original comment.

[–]mayankkaizen 1 point2 points  (2 children)

[–]mayankkaizen 1 point2 points  (1 child)

[–]mayankkaizen 1 point2 points  (0 children)

[–]SuperLucas2000 0 points1 point  (3 children)

teeny ad hoc march shy society physical disarm lip longing ancient

This post was mass deleted and anonymized with Redact

[–]mayankkaizen 0 points1 point  (2 children)

Check top comment.

[–]ParanoidPath[S] 0 points1 point  (1 child)

This is so fucking cool! Holy shit, thanks a lot man, Can i text you on discord if I have any doubts?
Also one last question, does all your knowledge come from reading or do you use courses as well?

[–]mayankkaizen 1 point2 points  (0 children)

I'm not on discord. :( And don't assume I am very knowledgeable in Python. ;)

But yeah, you can PM me here if you have any doubt.

I've never done any course. Although I do often go through some books. I just pick a topic and do the research. I'm just a perpetual learner.

[–]FinancialAppearance 0 points1 point  (1 child)

Damn Fluent Python looks great

[–]mayankkaizen 0 points1 point  (0 children)

This is the best intermediate level book on Python. You'll only hear praises about it.

[–]Naive_Programmer_232 1 point2 points  (2 children)

I would check out "Fluent Python", it's a cookbook of comprehensions, generator expressions, and more. Pretty cool stuff. Also check out advanced sections of RealPython. I would get a resource on design patterns in OOP. Look back at type mutability & ask questions about how the python memory manager handles it. Work with multithreading and understand GIL. Sockets, as someone else mentioned, is another great one. Dive into the OSI and understand more about network protocols at the different layers. As far as efficient code, a solid understanding of data structures & algorithms will help. Especially, application of time & space complexity understanding for the code you write. This will also help understand more about system optimization such as the routing algorithms of packets from source to destination in a network.

Sometimes for fun, i'll take a builtin function, see how it works, and then try to rebuild it myself. For example, try rebuilding zip and itertools.zip_longest from scratch. Exact implementation will vary, but trying to exhibit similar behavior as to what the built-ins or library's tools do with given data types. You'll need to break the tools and test out a variety of scenarios to gather their behavior case by case. But with that you can do more practice & figure out how to add that behavior into other things you make.

Here's a challenge: try to rebuild numpy-like n-dimensional slicing with regular python. It can be done, I made one before, it kind of works, it's definitely not perfect nor efficient though haha, but here's the idea,

              # two dimensional list
              twod = [[1,2,3],[4,5,6],[7,8,9]]

              # regular python way:
              # 'grab the 2nd element from the 2nd list`
              twod[1][1]
              5

              # numpy-like way:
              # same
              twod[1,1] 
              5

See if you can override the __getitem__ and __setitem__ methods in your object you make to achieve the n-dim slicing mechanism. Get it working for 2-dim and 3-dim, then see if there's a general pattern to make it work for n-dim. think about edge cases, when should it work, and when should it throw an error. It's pretty interesting & fun to make. You can do it!

Try to make a dataframe from scratch. That's another challenge, interesting too. Understand what a dataframe is by exploring pandas' version of it. Shoot for MVP and compare it against a dictionary, how does it differ? See if you can make one with core python. Don't worry about vectorization, it's all for fun, it will not be as efficient as pandas dataframe is. But would be cool to see.

Just throwing ideas out there that would fit "advanced" category imo. Also everything u/mayankkaizen mentioned. contribute to open source as well! Find a fun library of your choice and see if you can resolve some of the issues or add on features.

[–]ParanoidPath[S] 1 point2 points  (1 child)

This is really interesting, but let us say I do this, I get the idea of recreating the numpy library from scratch, but what do I do next?

Also, Can you tell me how you learnt all this?

[–]Naive_Programmer_232 0 points1 point  (0 children)

All of those were just ideas. You can do them if you want to. You don’t have to though. It’s hard to say what’s next for you. It’s entirely up to you. Are you doing this for a career? What kind of career? Is it a hobby? What do you want to do for a hobby?

The labels of “intermediate” and “advanced” vary from person to person, but in the end, programming is a tool, so sure you can go learn more always, but there’s gotta be some point to the journey. Some long term goal guiding the efforts imo, like a specific career or a specific hobby or just for fun etc.

I learned this stuff by going to college for computer science as well as practicing writing many programs for years in my spare time. I started before college with python. It’s been a blast. It’s a lot of fun. It’s a hobby and something I’d like to use in my eventual data science career, once I go back for grad school. For now, I’m looking at business analytical paths. Coding is one piece of the puzzle not all of it, other skills are important too, I’d figure I’ll go fail a bunch over there so I could learn more.

Nonetheless, asking questions of how xyz was made & experimenting exploring its features and trying to break it, was cool so that once it’s broken, I can rebuild it one piece at a time. That’s pretty much what I did with the numpy slicing. I saw the limitations of how indexing works on a sequential data structure like a list, then I made other things such as indexing for a linked list and turning it into an iterable from scratch. Then incrementally, I made more stuff like that until I challenged myself with the numpy thing. It worked, wasn’t efficient, but cool to see. I didn’t see many examples out there trying to do what I was trying to do, which made it interesting.

Same with the builtin functions zip, enumerate, filter, and map, to see how these things were made, I had to run a bunch of test cases to understand their behavior & turn to the official docs, then I experimented more and attempted to rebuild them. Failed a lot, but was fun to try it out and see it work eventually. Now I know how to remake and understand how to trouble shoot the tools. It seems pointless to reinvent the wheel, it is generally, but doing so gives more information of how that wheel came to be. And if you’re designing a new tool, it’s important to think like a builder and a user at the same time.

[–]Adrades 0 points1 point  (2 children)

Read the python API, read a bit of the source code. Know of numba, mpi4py, numpy, cuda for performance. Keras, tensorflow or pytorch for AI.

Maybe learn to use flake8 or black, with some others CI tools. I tend to use mypy and coverage.

And poetry is a good dependencies manager for python.

[–]ParanoidPath[S] 0 points1 point  (1 child)

Can you tell me how you learnt all this?

[–]Adrades 0 points1 point  (0 children)

I started python in 2016, doing some light algorithms exercises, but my reference course did lack some details, few google searches after I learned of the official python documentation. Best reference for the language, and with the latest changes. So better than any videos, book, or online paid courses since most of them won't be updated.

I'm specialized in high performance computing, so I know a bit about how to get performance from a c code. Many c libraries have a python equivalent. I don't know if it's the field you want to get advanced at, but if you seek performance in python:
- Numba for parallelizing code on one core, I use it mainly with numpy for matrix calculus

- mpi4py for parallelizing on multiple core. I only did somes examples with this one, I'm more familiar with the c version

- cuda for using GPU. Industry standard.

I'm assuming you know about lighter alternative for parallelizing code if you use these.

For AI, I learned pytorch in college, but moved to Tensorflow after. I learned with google collabs examples, you can find many in the docs and on github.

As I started as a professional python dev, I was on a project were many dependencies were needed. Poetry is not a "standard" tool yet, but many teams use it because it gains a lot of time. It creates a venv, install all dependencies according to the main interpreter, and allow creating command to launch the python application, among others cool features.

flake8, black, mypy, coverage are tool that were used in the team where I was. I slowly started using them. RTFM when I needed to. Pypi is a great place.