Add policy about non-ASCII names to coding standard.
This commit is contained in:
parent
cf5e852a1e
commit
65d78ad8f2
28
pep-0008.txt
28
pep-0008.txt
|
@ -120,13 +120,29 @@ Code lay-out
|
|||
|
||||
Encodings (PEP 263)
|
||||
|
||||
Code in the core Python distribution should aways use the ASCII or Latin-1
|
||||
encoding (a.k.a. ISO-8859-1).
|
||||
Code in the core Python distribution should aways use the ASCII or
|
||||
Latin-1 encoding (a.k.a. ISO-8859-1). For Python 3.0 and beyond,
|
||||
UTF-8 is preferred over Latin-1, see PEP 3120.
|
||||
|
||||
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.
|
||||
Files using ASCII (or UTF-8, for Python 3.0) should not have a
|
||||
coding cookie. Latin-1 (or UTF-8) should only be used when a
|
||||
comment or docstring needs to mention an author name that requires
|
||||
Latin-1; otherwise, using \x, \u or \U escapes is the preferred
|
||||
way to include non-ASCII data in string literals.
|
||||
|
||||
For Python 3.0 and beyond, the following policy is prescribed for
|
||||
the standard library (see PEP 3131): All identifiers in the Python
|
||||
standard library MUST use ASCII-only identifiers, and SHOULD use
|
||||
English words wherever feasible (in many cases, abbreviations and
|
||||
technical terms are used which aren't English). In addition,
|
||||
string literals and comments must also be in ASCII. The only
|
||||
exceptions are (a) test cases testing the non-ASCII features, and
|
||||
(b) names of authors. Authors whose names are not based on the
|
||||
latin alphabet MUST provide a latin transliteration of their
|
||||
names.
|
||||
|
||||
Open source projects with a global audience are encouraged to
|
||||
adopt a similar policy.
|
||||
|
||||
|
||||
Imports
|
||||
|
|
Loading…
Reference in New Issue