Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0b2833ea
Commit
0b2833ea
authored
Aug 06, 2015
by
Robert Collins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #24531: Document that encoding lines cannot follow non-comment lines.
Patch from Terry Reedy
parent
79b98df0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Doc/reference/lexical_analysis.rst
Doc/reference/lexical_analysis.rst
+4
-2
No files found.
Doc/reference/lexical_analysis.rst
View file @
0b2833ea
...
...
@@ -81,7 +81,9 @@ Encoding declarations
If a comment in the first or second line of the Python script matches the
regular expression ``coding[=:]\s*([-\w.]+)``, this comment is processed as an
encoding declaration; the first group of this expression names the encoding of
the source code file. The recommended forms of this expression are ::
the source code file. The encoding declaration must appear on a line of its
own. If it is the second line, the first line must also be a comment-only line.
The recommended forms of an encoding expression are ::
# -*- coding: <encoding-name> -*-
...
...
@@ -98,7 +100,7 @@ among others, by Microsoft's :program:`notepad`).
If an encoding is declared, the encoding name must be recognized by Python. The
encoding is used for all lexical analysis, including string literals, comments
and identifiers.
The encoding declaration must appear on a line of its own.
and identifiers.
.. XXX there should be a list of supported encodings.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment