summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmmar Askar <ammar_askar@hotmail.com>2018-06-09 23:49:39 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2018-06-09 23:49:39 (GMT)
commit0aa17ee6a76df0946d42e7657a501f1862065a22 (patch)
treeb87633bcab9370f4efeb30d1955f92e715f2fbe9
parent7e0d882a98169e6d8d1507224b83ff0264c2afee (diff)
downloadcpython-0aa17ee6a76df0946d42e7657a501f1862065a22.zip
cpython-0aa17ee6a76df0946d42e7657a501f1862065a22.tar.gz
cpython-0aa17ee6a76df0946d42e7657a501f1862065a22.tar.bz2
bpo-33766: Document that end of file or string is a newline (GH-7383)
-rw-r--r--Doc/reference/lexical_analysis.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 1fe1a51..84e8c78 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -47,11 +47,12 @@ Physical lines
--------------
A physical line is a sequence of characters terminated by an end-of-line
-sequence. In source files, any of the standard platform line termination
-sequences can be used - the Unix form using ASCII LF (linefeed), the Windows
-form using the ASCII sequence CR LF (return followed by linefeed), or the old
-Macintosh form using the ASCII CR (return) character. All of these forms can be
-used equally, regardless of platform.
+sequence. In source files and strings, any of the standard platform line
+termination sequences can be used - the Unix form using ASCII LF (linefeed),
+the Windows form using the ASCII sequence CR LF (return followed by linefeed),
+or the old Macintosh form using the ASCII CR (return) character. All of these
+forms can be used equally, regardless of platform. The end of input also serves
+as an implicit terminator for the final physical line.
When embedding Python, source code strings should be passed to Python APIs using
the standard C conventions for newline characters (the ``\n`` character,