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

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.

主站蜘蛛池模板: 印江| 桐乡市| 玛纳斯县| 芒康县| 华坪县| 苍山县| 富川| 治县。| 赤峰市| 贡嘎县| 济阳县| 托克逊县| 舒城县| 西贡区| 开封市| 晋中市| 平顶山市| 玉树县| 于田县| 潍坊市| 民乐县| 乳山市| 南投市| 清河县| 光泽县| 偃师市| 淮滨县| 河北省| 高邑县| 呼玛县| 曲沃县| 扎兰屯市| 龙海市| 滦平县| 布拖县| 石楼县| 临洮县| 宣武区| 古浪县| 德钦县| 互助|