What are some good examples of Pythonic libraries?

I'm curious what others consider to be good, Pythonic code.

What I mean by Pythonic are libraries that show nice and idiomatic Python code. Compliance with Python rules. 1. Good naming, proper use of modules and, as a rule, the following best practices, etc.

What is your favorite idiomatic Python library? Please provide justification for your response.

+4
source share
2 answers

Have you looked at the source code of the Python standard library ? This can give you an idea of ​​the different features for the correct Python style. Not all of them follow PEP 8, but you can learn a lot just by looking. I recommend that you look at the modules contained in one file to get the full picture. Specific examples in the source include:

Keep in mind that this does not mean that these modules should be taken as β€œsample Python code,” but the point remains: they are good enough, because they should be included in the standard Python distribution.

For more complex modules, check out the standard email package or the Django source code. Again, not necessarily after PEP 8, but used by thousands (and beloved by many). A.

In fairness it is worth saying that there is a balance between the amazing Python code tomorrow and decent working code.

Greetings

Juan

+3
source

boto3 . Great test suite and package structure. Same thing for Celery .

0
source

Source: https://habr.com/ru/post/1313573/


All Articles