Fixes to PEP 263 and PEP 272 (#198)
PEP 263: remove extra colon and unnecessary backticks PEP 272: remove extra colon and change back traceback code
This commit is contained in:
parent
08a96a3151
commit
d1d344880b
|
@ -67,10 +67,10 @@ or (using formats recognized by popular editors)::
|
||||||
or::
|
or::
|
||||||
|
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# vim: set fileencoding=<encoding name> ::
|
# vim: set fileencoding=<encoding name> :
|
||||||
|
|
||||||
More precisely, the first or second line must match the regular
|
More precisely, the first or second line must match the regular
|
||||||
expression "``^[ \t\v]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)```".
|
expression "^[ \t\v]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)".
|
||||||
The first group of this
|
The first group of this
|
||||||
expression is then interpreted as encoding name. If the encoding
|
expression is then interpreted as encoding name. If the encoding
|
||||||
is unknown to Python, an error is raised during compilation. There
|
is unknown to Python, an error is raised during compilation. There
|
||||||
|
@ -80,7 +80,7 @@ is ignored.
|
||||||
|
|
||||||
To aid with platforms such as Windows, which add Unicode BOM marks
|
To aid with platforms such as Windows, which add Unicode BOM marks
|
||||||
to the beginning of Unicode files, the UTF-8 signature
|
to the beginning of Unicode files, the UTF-8 signature
|
||||||
'``\xef\xbb\xbf``' will be interpreted as 'utf-8' encoding as well
|
'\xef\xbb\xbf' will be interpreted as 'utf-8' encoding as well
|
||||||
(even if no magic encoding comment is given).
|
(even if no magic encoding comment is given).
|
||||||
|
|
||||||
If a source file uses both the UTF-8 BOM mark signature and a
|
If a source file uses both the UTF-8 BOM mark signature and a
|
||||||
|
|
|
@ -191,8 +191,8 @@ Here's an example, using a module named 'DES'::
|
||||||
>>> len(plaintext)
|
>>> len(plaintext)
|
||||||
34
|
34
|
||||||
>>> obj.encrypt(plaintext)
|
>>> obj.encrypt(plaintext)
|
||||||
Traceback (innermost last)::
|
Traceback (innermost last):
|
||||||
File "<stdin>", line 1, in <module>
|
File "<stdin>", line 1, in ?
|
||||||
ValueError: Strings for DES must be a multiple of 8 in length
|
ValueError: Strings for DES must be a multiple of 8 in length
|
||||||
>>> ciphertext = obj.encrypt(plain+'XXXXXX') # Add padding
|
>>> ciphertext = obj.encrypt(plain+'XXXXXX') # Add padding
|
||||||
>>> ciphertext
|
>>> ciphertext
|
||||||
|
|
Loading…
Reference in New Issue