|
1 | | -# Python-PEP8- |
2 | | -Python PEP8 编码规范 https://www.python.org/dev/peps/pep-0008/ |
| 1 | +# PEP 8 - Style Guide for Python Code |
| 2 | + |
| 3 | +## Contents |
| 4 | + |
| 5 | +* [Introduction - 简介](#1) |
| 6 | +* [A Foolish Consistency is the Hobgoblin of Little Minds - 愚蠢的一致性是小心灵的大地精](#2) |
| 7 | +* [Code lay-out - 代码布局](#3) |
| 8 | + * [Indentation - 缩进](#3.1) |
| 9 | + * [Tabs or Spaces? - 制表符还是空格符?](#3.2) |
| 10 | + * [Maximum Line Length](#3.3) |
| 11 | + * [Should a line break before or after a binary operator?](#3.4) |
| 12 | + * [Blank Lines](#3.5) |
| 13 | + * [Source File Encoding](#3.6) |
| 14 | + * [Imports](#3.7) |
| 15 | + * [Module level dunder names](#3.8) |
| 16 | +* [String Quotes](#4) |
| 17 | +* [Whitespace in Expressions and Statements](#5) |
| 18 | + * [Pet Peeves](#5.1) |
| 19 | + * [Other Recommendations](#5.2) |
| 20 | +* [When to use trailing commas](#6) |
| 21 | +* [Comments](#7) |
| 22 | + * [Block Comments](#7.1) |
| 23 | + * [Inline Comments](#7.2) |
| 24 | + * [Documentation Strings](#7.3) |
| 25 | +* [Naming Conventions](#8) |
| 26 | + * [Overriding Principle](#8.1) |
| 27 | + * [Descriptive: Naming Styles](#8.2) |
| 28 | + * [Prescriptive: Naming Conventions](#8.3) |
| 29 | + * [Names to Avoid](#8.3.1) |
| 30 | + * [Package and Module Names](#8.3.2) |
| 31 | + * [Class Names](#8.3.3) |
| 32 | + * [Type variable names](#8.3.4) |
| 33 | + * [Exception Names](#8.3.5) |
| 34 | + * [Global Variable Names](#8.3.6) |
| 35 | + * [Function Names](#8.3.7) |
| 36 | + * [Function and method arguments](#8.3.8) |
| 37 | + * [Method Names and Instance Variables](#8.3.9) |
| 38 | + * [Constants](#8.3.10) |
| 39 | + * [Designing for inheritance](#8.3.11) |
| 40 | + * [Public and internal interfaces](#8.4) |
| 41 | +* [Programming Recommendations](#9) |
| 42 | + * [Function Annotations](#9.1) |
| 43 | +* [References](#10) |
| 44 | +* [Copyright](#11) |
| 45 | + |
| 46 | +<h4 id="1">简介</h4> |
0 commit comments