Reduce desirability of using 100 chars per line.
This commit is contained in:
parent
bbc946a16a
commit
5a0c59d25c
19
pep-0008.txt
19
pep-0008.txt
|
@ -159,12 +159,11 @@ These options are highly recommended!
|
||||||
Maximum Line Length
|
Maximum Line Length
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
Aim to limit all lines to a maximum of 79 characters, but up to 99
|
Limit all lines to a maximum of 79 characters.
|
||||||
characters is acceptable when it improves readability.
|
|
||||||
|
|
||||||
For flowing long blocks of text with fewer structural restrictions
|
For flowing long blocks of text with fewer structural restrictions
|
||||||
(docstrings or comments), limiting the line length to 72 characters
|
(docstrings or comments), the line length should be limited to 72
|
||||||
is recommended.
|
characters.
|
||||||
|
|
||||||
Limiting the required editor window width makes it possible to have
|
Limiting the required editor window width makes it possible to have
|
||||||
several files open side-by-side, and works well when using code
|
several files open side-by-side, and works well when using code
|
||||||
|
@ -172,10 +171,20 @@ review tools that present the two versions in adjacent columns.
|
||||||
|
|
||||||
The default wrapping in most tools disrupts the visual structure of the
|
The default wrapping in most tools disrupts the visual structure of the
|
||||||
code, making it more difficult to understand. The limits are chosen to
|
code, making it more difficult to understand. The limits are chosen to
|
||||||
avoid wrapping in editors with the window width set to 80 (or 100), even
|
avoid wrapping in editors with the window width set to 80, even
|
||||||
if the tool places a marker glyph in the final column when wrapping
|
if the tool places a marker glyph in the final column when wrapping
|
||||||
lines. Some web based tools may not offer dynamic line wrapping at all.
|
lines. Some web based tools may not offer dynamic line wrapping at all.
|
||||||
|
|
||||||
|
Some teams strongly prefer a longer line length. For code maintained
|
||||||
|
exclusively or primarily by a team that can reach agreement on this
|
||||||
|
issue, it is okay to increase the line nominal line length from 80 to
|
||||||
|
100 characters (effectively increasing the maximum length to 99
|
||||||
|
characters), provided that comments and docstrings are still wrapped
|
||||||
|
at 72 characters.
|
||||||
|
|
||||||
|
The Python standard library is conservative and requires limiting
|
||||||
|
lines to 79 characters (and docstrings/comments to 72).
|
||||||
|
|
||||||
The preferred way of wrapping long lines is by using Python's implied
|
The preferred way of wrapping long lines is by using Python's implied
|
||||||
line continuation inside parentheses, brackets and braces. Long lines
|
line continuation inside parentheses, brackets and braces. Long lines
|
||||||
can be broken over multiple lines by wrapping expressions in
|
can be broken over multiple lines by wrapping expressions in
|
||||||
|
|
Loading…
Reference in New Issue