mirror of
https://github.com/python/cpython.git
synced 2025-11-12 23:16:47 +00:00
Revised description of blank line handling for the interpreter, based
on a comment from /F.
This commit is contained in:
parent
fab41f1788
commit
c411fa6861
1 changed files with 11 additions and 7 deletions
|
|
@ -89,6 +89,7 @@ for string literals (i.e., tokens other than string literals cannot be
|
||||||
split across physical lines using a backslash). A backslash is
|
split across physical lines using a backslash). A backslash is
|
||||||
illegal elsewhere on a line outside a string literal.
|
illegal elsewhere on a line outside a string literal.
|
||||||
|
|
||||||
|
|
||||||
\subsection{Implicit line joining\label{implicit-joining}}
|
\subsection{Implicit line joining\label{implicit-joining}}
|
||||||
|
|
||||||
Expressions in parentheses, square brackets or curly braces can be
|
Expressions in parentheses, square brackets or curly braces can be
|
||||||
|
|
@ -108,14 +109,17 @@ allowed. There is no NEWLINE token between implicit continuation
|
||||||
lines. Implicitly continued lines can also occur within triple-quoted
|
lines. Implicitly continued lines can also occur within triple-quoted
|
||||||
strings (see below); in that case they cannot carry comments.
|
strings (see below); in that case they cannot carry comments.
|
||||||
|
|
||||||
\subsection{Blank lines\label{blank-lines}}
|
|
||||||
|
|
||||||
A logical line that contains only spaces, tabs, formfeeds and possibly a
|
\subsection{Blank lines \index{blank line}\label{blank-lines}}
|
||||||
comment, is ignored (i.e., no NEWLINE token is generated), except that
|
|
||||||
during interactive input of statements, an entirely blank logical line
|
A logical line that contains only spaces, tabs, formfeeds and possibly
|
||||||
(i.e. one containing not even whitespace or a comment)
|
a comment, is ignored (i.e., no NEWLINE token is generated). During
|
||||||
terminates a multi-line statement.
|
interactive input of statements, handling of a blank line may differ
|
||||||
\index{blank line}
|
depending on the implementation of the read-eval-print loop. In the
|
||||||
|
standard implementation, an entirely blank logical line (i.e.\ one
|
||||||
|
containing not even whitespace or a comment) terminates a multi-line
|
||||||
|
statement.
|
||||||
|
|
||||||
|
|
||||||
\subsection{Indentation\label{indentation}}
|
\subsection{Indentation\label{indentation}}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue