- Daniel Arbuckle's Mastering Python
- Daniel Arbuckle
- 185字
- 2021-07-02 21:09:40
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:
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.
- Advanced Splunk
- SPSS數據挖掘與案例分析應用實踐
- WildFly:New Features
- Learning Informatica PowerCenter 10.x(Second Edition)
- PLC編程及應用實戰
- TypeScript實戰指南
- C語言程序設計
- Haskell Data Analysis Cookbook
- Mastering Unity 2D Game Development(Second Edition)
- C#開發案例精粹
- Java 從入門到項目實踐(超值版)
- Vue.js 3應用開發與核心源碼解析
- Scala Functional Programming Patterns
- scikit-learn Cookbook(Second Edition)
- Hack與HHVM權威指南