Remove a bunch of Emacs references. They're unnecessary for making the point.

This commit is contained in:
Barry Warsaw 2005-12-15 15:44:35 +00:00
parent 8ca944f9e1
commit 9d3a63d38d
1 changed files with 15 additions and 22 deletions

View File

@ -53,10 +53,8 @@ Code lay-out
Use 4 spaces per indentation level.
This is the default for Emacs's python-mode. For really old code that you
don't want to mess up, you can continue to use 8-space tabs. Emacs
python-mode auto-detects the prevailing indentation level used in a file
and sets its indentation parameters accordingly.
For really old code that you don't want to mess up, you can continue to
use 8-space tabs.
Tabs or Spaces?
@ -64,15 +62,13 @@ Code lay-out
The most popular way of indenting Python is with spaces only. The
second-most popular way is with tabs only. Code indented with a mixture
of tabs and spaces should be converted to using spaces exclusively. (In
Emacs, select the whole buffer and hit ESC-x untabify.) When invoking the
Python command line interpreter with the -t option, it issues warnings
about code that illegally mixes tabs and spaces. When using -tt these
warnings become errors. These options are highly recommended!
of tabs and spaces should be converted to using spaces exclusively. When
invoking the Python command line interpreter with the -t option, it issues
warnings about code that illegally mixes tabs and spaces. When using -tt
these warnings become errors. These options are highly recommended!
For new projects, spaces-only are strongly recommended over tabs. Most
editors have features that make this easy to do. (In Emacs, make sure
indent-tabs-mode is nil).
editors have features that make this easy to do.
Maximum Line Length
@ -81,16 +77,15 @@ Code lay-out
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to have
several windows side-by-side. The default wrapping on such devices looks
ugly. Therefore, please limit all lines to a maximum of 79 characters
(Emacs wraps lines that are exactly 80 characters long). For flowing long
blocks of text (docstrings or comments), limiting the length to 72
characters is recommended.
ugly. Therefore, please limit all lines to a maximum of 79 characters.
For flowing long blocks of text (docstrings or comments), limiting the
length to 72 characters is recommended.
The preferred way of wrapping long lines is by using Python's implied line
continuation inside parentheses, brackets and braces. If necessary, you
can add an extra pair of parentheses around an expression, but sometimes
using a backslash looks better. Make sure to indent the continued line
appropriately. Emacs's python-mode does this right. Some examples:
appropriately. Some examples:
class Rectangle(Blob):
@ -119,8 +114,8 @@ Code lay-out
Use blank lines in functions, sparingly, to indicate logical sections.
Python accepts the control-L (i.e. ^L) form feed character as whitespace;
Emacs (and some printing tools) treat these characters as page separators,
so you may use them to separate pages of related sections of your file.
Many tools treat these characters as page separators, so you may use them
to separate pages of related sections of your file.
Encodings (PEP 263)
@ -130,8 +125,7 @@ Code lay-out
Files using ASCII should not have a coding cookie. Latin-1 should only be
used when a comment or docstring needs to mention an author name that
requires Latin-1; otherwise, using \x escapes is the preferred way to
include non-ASCII data in string literals. An exception is made for those
files that are part of the test suite for the code implementing PEP 263.
include non-ASCII data in string literals.
Imports
@ -314,8 +308,7 @@ Comments
comments generally consist of one or more paragraphs built out of complete
sentences, and each sentence should end in a period.
You should use two spaces after a sentence-ending period, since it
makes Emacs wrapping and filling work consistently.
You should use two spaces after a sentence-ending period.
When writing English, Strunk and White apply.