官术网_书友最值得收藏!

PEP 8 — guidelines for Python code

The very first rule PEP 8 introduces is that rules/guidelines in PEP 8 should only apply when they make our code easier to read. This means we should apply PEP 8 to enhance the readability of the code and to make it less complex. For example, if we're working on a project that was already written with a different coding style (that is, it is already easy to read), we should use that project style for new code. If the PEP 8 rules somehow make the code harder to read or make it complex while writing the code, we should ignore those rules. As Guido Van Rossum, the creator of Python, has noted:

Code is read more often than it is written.
Code should always be written in a way that promotes readability.

For more information on PEP 8 rules and guidelines, you can refer to the following link:
https://www.python.org/dev/peps/pep-0008/

To know when to ignore a particular guideline, you can follow the A Foolish Consistency is the Hobgoblin of Little Minds article at the following link:
https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds.

主站蜘蛛池模板: 洛隆县| 阿拉善右旗| 昌乐县| 维西| 云霄县| 合水县| 达拉特旗| 忻城县| 五峰| 钟祥市| 竹北市| 无极县| 广南县| 延吉市| 措勤县| 太仓市| 大埔区| 亳州市| 宽甸| 察隅县| 临湘市| 滦平县| 井研县| 翁牛特旗| 黔东| 海安县| 大厂| 丹棱县| 昌江| 沁阳市| 霞浦县| 镇巴县| 大悟县| 尚志市| 禹城市| 壤塘县| 巫山县| 崇左市| 镇雄县| 绥芬河市| 亳州市|