summaryrefslogtreecommitdiff
path: root/Doc/reference
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-06-09 17:05:49 -0700
committerGitHub <noreply@github.com>2018-06-09 17:05:49 -0700
commit0cf58f494c9f8a017d8f8cf8d69ae2048414068b (patch)
tree99ad0d077ba123504cd4190d3fbb2c55a410ec84 /Doc/reference
parent055bd80fd9c10bccc2fb5ea33e8136792b8bfb9a (diff)
downloadcpython-git-0cf58f494c9f8a017d8f8cf8d69ae2048414068b.tar.gz
bpo-33766: Document that end of file or string is a newline (GH-7383)
(cherry picked from commit 0aa17ee6a76df0946d42e7657a501f1862065a22) Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
Diffstat (limited to 'Doc/reference')
-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 1fe1a51a9c..84e8c78383 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,