applies both to the source character set and the run-time character
set.
+
\section{Line structure\label{line-structure}}
A Python program is divided into a number of \emph{logical lines}.
\index{line structure}
+
\subsection{Logical lines\label{logical}}
The end of
\index{line joining}
\index{NEWLINE token}
+
\subsection{Physical lines\label{physical}}
A physical line ends in whatever the current platform's convention is
followed by linefeed). On Macintosh, it is the \ASCII{} CR (return)
character.
+
\subsection{Comments\label{comments}}
A comment starts with a hash character (\code{\#}) that is not part of
\index{comment}
\index{hash character}
+
\subsection{Explicit line joining\label{explicit-joining}}
Two or more physical lines may be joined into logical lines using
last error is found by the lexical analyzer --- the indentation of
\code{return r} does not match a level popped off the stack.)
+
\subsection{Whitespace between tokens\label{whitespace}}
Except at the beginning of a logical line or in string literals, the
tokens only if their concatenation could otherwise be interpreted as a
different token (e.g., ab is one token, but a b is two tokens).
+
\section{Other tokens\label{other-tokens}}
Besides NEWLINE, INDENT and DEDENT, the following categories of tokens
ambiguity exists, a token comprises the longest possible string that
forms a legal token, when read from left to right.
+
\section{Identifiers and keywords\label{identifiers}}
Identifiers (also referred to as \emph{names}) are described by the following
Identifiers are unlimited in length. Case is significant.
+
\subsection{Keywords\label{keywords}}
The following identifiers are used as reserved words, or
and del for is raise
assert elif from lambda return
break else global not try
-class except if or while
-continue exec import pass
+class except if or yeild
+continue exec import pass while
def finally in print
\end{verbatim}
% When adding keywords, use reswords.py for reformatting
+
\subsection{Reserved classes of identifiers\label{id-classes}}
Certain classes of identifiers (besides keywords) have special
\index{literal}
\index{constant}
+
\subsection{String literals\label{strings}}
String literals are described by the following lexical definitions:
backslash followed by a newline is interpreted as those two characters
as part of the string, \emph{not} as a line continuation.
+
\subsection{String literal concatenation\label{string-catenation}}
Multiple adjacent string literals (delimited by whitespace), possibly
\code{-1} is actually an expression composed of the unary operator
`\code{-}' and the literal \code{1}.
+
\subsection{Integer and long integer literals\label{integers}}
Integer and long integer literals are described by the following
3L 79228162514264337593543950336L 0377L 0x100000000L
\end{verbatim}
+
\subsection{Floating point literals\label{floating}}
Floating point literals are described by the following lexical
\code{-1} is actually an expression composed of the operator
\code{-} and the literal \code{1}.
+
\subsection{Imaginary literals\label{imaginary}}
Imaginary literals are described by the following lexical definitions:
spellings of the same operator. \code{!=} is the preferred spelling;
\code{<>} is obsolescent.
+
\section{Delimiters\label{delimiters}}
The following tokens serve as delimiters in the grammar: