Record that the Py3k C coding style will use 4 spaces, no tabs.
And record when it's okay to reformat a file to conform.
This commit is contained in:
parent
c854ad6eb9
commit
85f11c2af4
11
pep-0007.txt
11
pep-0007.txt
|
@ -28,6 +28,9 @@ Introduction
|
||||||
C dialect
|
C dialect
|
||||||
|
|
||||||
- Use ANSI/ISO standard C (the 1989 version of the standard).
|
- Use ANSI/ISO standard C (the 1989 version of the standard).
|
||||||
|
This means (amongst many other things) that all declarations
|
||||||
|
must be at the top of a block (not necessarily at the top of
|
||||||
|
function).
|
||||||
|
|
||||||
- Don't use GCC extensions (e.g. don't write multi-line strings
|
- Don't use GCC extensions (e.g. don't write multi-line strings
|
||||||
without trailing backslashes).
|
without trailing backslashes).
|
||||||
|
@ -44,6 +47,7 @@ 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.
|
||||||
|
(For Python 3000, see the section Python 3000 below.)
|
||||||
|
|
||||||
- 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
|
||||||
|
@ -189,6 +193,13 @@ 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, 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
|
||||||
|
|
10
pep-3100.txt
10
pep-3100.txt
|
@ -50,6 +50,16 @@ Influencing PEPs
|
||||||
* PEP 352 (Required Superclass for Exceptions) [#pep352]_
|
* PEP 352 (Required Superclass for Exceptions) [#pep352]_
|
||||||
|
|
||||||
|
|
||||||
|
Style changes
|
||||||
|
=============
|
||||||
|
|
||||||
|
* The C style guide will be updated to use 4-space indents, never tabs.
|
||||||
|
This style should be used for all new files; existing files can be
|
||||||
|
updated only if there is no hope to ever merge a particular file from
|
||||||
|
the Python 2 HEAD. Within a file, the indentation style should be
|
||||||
|
consistent. No other style guide changes are planned ATM.
|
||||||
|
|
||||||
|
|
||||||
Core language
|
Core language
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue