Code Style

https://d33wubrfki0l68.cloudfront.net/1155a77ae015f873c4faea76d55e5ccf73a0cfa1/6c6e8/_images/33907150054_5ee79e8940_k_d.jpg If you ask Python programmers what they like most about Python, they willoften cite its high readability. Indeed, a high level of readabilityis at the heart of the design of the Python language, following therecognized fact that code is read much more often than it is written.

One reason for the high readability of Python code is its relativelycomplete set of Code Style guidelines and “Pythonic” idioms.

When a veteran Python developer (a Pythonista) calls portions ofcode not “Pythonic”, they usually mean that these linesof code do not follow the common guidelines and fail to express its intent inwhat is considered the best (hear: most readable) way.

On some border cases, no best way has been agreed upon on how to expressan intent in Python code, but these cases are rare.

原文: https://docs.python-guide.org/writing/style/