Clarify indentation policy for old and new files.
This commit is contained in:
parent
10bcc45a43
commit
233c85b67a
17
pep-0007.txt
17
pep-0007.txt
|
@ -46,9 +46,13 @@ C dialect
|
||||||
|
|
||||||
Code lay-out
|
Code lay-out
|
||||||
|
|
||||||
- Use single-tab indents, where a tab is worth 8 spaces.
|
- Use single-tab indents, where a tab is worth 8 spaces, in files
|
||||||
(For Python 3000 and entirely new source files, see the section
|
that already use tabs. In new source files, and the few files
|
||||||
Python 3000 below.)
|
that were created after this rule was introduced, use 4-space
|
||||||
|
indents and no tabs at all.
|
||||||
|
|
||||||
|
At some point, the whole codebase may be converted to use only
|
||||||
|
4-space indents.
|
||||||
|
|
||||||
- No line should be longer than 79 characters. If this and the
|
- No line should be longer than 79 characters. If this and the
|
||||||
previous rule together don't give you enough room to code, your
|
previous rule together don't give you enough room to code, your
|
||||||
|
@ -194,13 +198,6 @@ Documentation Strings
|
||||||
not all do; the MSVC compiler is known to complain about this.
|
not all do; the MSVC compiler is known to complain about this.
|
||||||
|
|
||||||
|
|
||||||
Python 3000
|
|
||||||
|
|
||||||
In Python 3000 (and in the 2.x series, in new source files),
|
|
||||||
we'll switch to a different indentation style: 4 spaces per indent,
|
|
||||||
all spaces (no tabs in any file). The rest will remain the same.
|
|
||||||
|
|
||||||
|
|
||||||
References
|
References
|
||||||
|
|
||||||
[1] PEP 8, Style Guide for Python Code, van Rossum, Warsaw
|
[1] PEP 8, Style Guide for Python Code, van Rossum, Warsaw
|
||||||
|
|
Loading…
Reference in New Issue