Skip to content

Commit f01b951

Browse files
bpo-33766: Document that end of file or string is a newline (pythonGH-7383)
(cherry picked from commit 0aa17ee) Co-authored-by: Ammar Askar <[email protected]>
1 parent f6645ef commit f01b951

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Doc/reference/lexical_analysis.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,12 @@ Physical lines
7373
--------------
7474

7575
A physical line is a sequence of characters terminated by an end-of-line
76-
sequence. In source files, any of the standard platform line termination
77-
sequences can be used - the Unix form using ASCII LF (linefeed), the Windows
78-
form using the ASCII sequence CR LF (return followed by linefeed), or the old
79-
Macintosh form using the ASCII CR (return) character. All of these forms can be
80-
used equally, regardless of platform.
76+
sequence. In source files and strings, any of the standard platform line
77+
termination sequences can be used - the Unix form using ASCII LF (linefeed),
78+
the Windows form using the ASCII sequence CR LF (return followed by linefeed),
79+
or the old Macintosh form using the ASCII CR (return) character. All of these
80+
forms can be used equally, regardless of platform. The end of input also serves
81+
as an implicit terminator for the final physical line.
8182

8283
When embedding Python, source code strings should be passed to Python APIs using
8384
the standard C conventions for newline characters (the ``\n`` character,

0 commit comments

Comments
 (0)