Skip to content

Commit

Permalink
Fixes to PEP 263 and PEP 272 (python#198)
Browse files Browse the repository at this point in the history
PEP 263: remove extra colon and unnecessary backticks
PEP 272: remove extra colon and change back traceback code
  • Loading branch information
Mariatta authored Feb 3, 2017
1 parent 08a96a3 commit d1d3448
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pep-0263.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ or (using formats recognized by popular editors)::
or::

#!/usr/bin/python
# vim: set fileencoding=<encoding name> ::
# vim: set fileencoding=<encoding name> :

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
expression is then interpreted as encoding name. If the encoding
is unknown to Python, an error is raised during compilation. There
Expand All @@ -80,7 +80,7 @@ is ignored.

To aid with platforms such as Windows, which add Unicode BOM marks
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).

If a source file uses both the UTF-8 BOM mark signature and a
Expand Down
4 changes: 2 additions & 2 deletions pep-0272.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ Here's an example, using a module named 'DES'::
>>> len(plaintext)
34
>>> obj.encrypt(plaintext)
Traceback (innermost last)::
File "<stdin>", line 1, in <module>
Traceback (innermost last):
File "<stdin>", line 1, in ?
ValueError: Strings for DES must be a multiple of 8 in length
>>> ciphertext = obj.encrypt(plain+'XXXXXX') # Add padding
>>> ciphertext
Expand Down

0 comments on commit d1d3448

Please sign in to comment.