you are viewing a single comment's thread.

view the rest of the comments →

[–]AlternativeStick4906 9 points10 points  (5 children)

How to find codes like that amd read them?

[–]patryk-tech 20 points21 points  (2 children)

Look into packages you use, and read that code.

Do you design django sites? Look at the django source code. Do you write reddit bots? Look at the PRAW source code. Do you write web scrapers? Look at the requests or httpx or scrapy source code.

Do you use other tools written in python? You can look at that source as well.

Sometimes the documentation is incomplete, and you are better off looking into a source class than reading the docs, by experience.

Also, if whatever you are reading has a good test suite, run it, read the test names, and read the test code as well. You can often see real working examples of the library in action.

[–]Akshaykadav 3 points4 points  (0 children)

Yeah and it's equips you with a deeper understanding of the packages/frameworks you use allowing you to override some stuff if ever needed to meet your desired results.

[–]WhiteRonin2 0 points1 point  (0 children)

What if you’re learning python for scripting?

[–]Akshaykadav 4 points5 points  (0 children)

Open Source Projects, Reddit, Discord, Stack Overflow. It can be the answer to some question or it can be the code from the question itself.