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

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.

主站蜘蛛池模板: 弥勒县| 库车县| 庆安县| 苍山县| 新野县| 民丰县| 明星| 九江县| 雅江县| 皋兰县| 名山县| 佛冈县| 沾化县| 平阳县| 怀远县| 黑山县| 神农架林区| 鄂托克前旗| 越西县| 金坛市| 正定县| 海盐县| 清水县| 遂溪县| 星子县| 会理县| 东港市| 江津市| 高青县| 河西区| 乐昌市| 蒲城县| 淳安县| 昭苏县| 信宜市| 盈江县| 株洲市| 中宁县| 永泰县| 松桃| 咸宁市|