Assuming you have the fundamentals down, I’d recommend taking the time to dig in and understand the source code of a couple well written packages. Start with some simple libraries like datetime, requests, flask and move on to more complex, modern examples like pandas / fastapi.
Clone the package, run the tests, break the tests and try adding functionality. You’ll learn a lot - I know I did when I was starting out.
I’d also recommend checking out Fluent Python.
- https://github.com/python-attrs/attrs
- https://github.com/mahmoud/glom
- https://github.com/pytoolz/toolz
- https://github.com/Suor/funcy
- https://github.com/dabeaz/curio
ps: dabaez has great educational content on writing idiomatic python, definitely worth checking out
An honorable mention of norvig's classic essays, which got me into python while I was in college, over 12y ago: https://norvig.com/spell-correct.html.Aside from reading code, _writing_ something that you know it exist (e.g glom) and then comparing it to how others have done it is also a great learning experience.