built-in modules are mentioned when they interact in a significant way
with the language definition.
+
\section{Notation\label{notation}}
The descriptions of lexical analysis and syntax use a modified BNF
\chapter{Data model\label{datamodel}}
+
\section{Objects, values and types\label{objects}}
\dfn{Objects} are Python's abstraction for data. All data in a Python
(Note that \samp{c = d = []} assigns the same object to both
\code{c} and \code{d}.)
+
\section{The standard type hierarchy\label{types}}
Below is a list of the types that are built into Python. Extension
\chapter{Execution model \label{execmodel}}
\index{execution model}
+
\section{Code blocks, execution frames, and namespaces \label{execframes}}
\index{code block}
\index{namespace}
are the same as for \code{othername}.
\index{syntax}
+
\section{Arithmetic conversions\label{conversions}}
\indexii{arithmetic}{conversion}
enclosure: parenth_form|list_display|dict_display|string_conversion
\end{verbatim}
+
\subsection{Identifiers (Names)\label{atom-identifiers}}
\index{name}
\index{identifier}
implementation defined truncation may happen. If the class name
consists only of underscores, no transformation is done.
+
\subsection{Literals\label{atom-literals}}
\index{literal}
\indexiii{immutable}{data}{type}
\indexii{immutable}{object}
+
\subsection{Parenthesized forms\label{parenthesized}}
\index{parenthesized form}
\index{comma}
\indexii{tuple}{display}
+
\subsection{List displays\label{lists}}
\indexii{list}{display}
\indexii{list}{comprehensions}
\obindex{list}
\indexii{empty}{list}
+
\subsection{Dictionary displays\label{dict}}
\indexii{dictionary}{display}
stored for a given key value prevails.
\indexii{immutable}{object}
+
\subsection{String conversions\label{string-conversions}}
\indexii{string}{conversion}
\indexii{reverse}{quotes}
\bifuncindex{repr}
\bifuncindex{str}
+
\section{Primaries\label{primaries}}
\index{primary}
primary: atom | attributeref | subscription | slicing | call
\end{verbatim}
+
\subsection{Attribute references\label{attribute-references}}
\indexii{attribute}{reference}
\obindex{module}
\obindex{list}
+
\subsection{Subscriptions\label{subscriptions}}
\index{subscription}
\index{character}
\indexii{string}{item}
+
\subsection{Slicings\label{slicings}}
\index{slicing}
\index{slice}
\withsubitem{(slice object attribute)}{\ttindex{start}
\ttindex{stop}\ttindex{step}}
+
\subsection{Calls\label{calls}}
\index{call}
a \exception{TypeError} exception is raised.
\exindex{TypeError}
+
\section{Binary arithmetic operations\label{binary}}
\indexiii{binary}{arithmetic}{operation}
type.
\index{subtraction}
+
\section{Shifting operations\label{shifting}}
\indexii{shifting}{operation}
exception.
\exindex{ValueError}
+
\section{Binary bit-wise operations\label{bitwise}}
\indexiii{binary}{bit-wise}{operation}
\indexii{bit-wise}{or}
\indexii{inclusive}{or}
+
\section{Comparisons\label{comparisons}}
\index{comparison}
\opindex{is not}
\indexii{identity}{test}
+
\section{Boolean operations\label{Booleans}}
\indexii{Boolean}{operation}
| exec_stmt
\end{verbatim}
+
\section{Expression statements \label{exprstmts}}
\indexii{expression}{statement}
\indexii{writing}{values}
\indexii{procedure}{call}
+
\section{Assert statements \label{assert}}
Assert statements\stindex{assert} are a convenient way to insert
Assignments to \code{__debug__} are illegal. The value for the
built-in variable is determined when the interpreter starts.
+
\section{Assignment statements \label{assignment}}
Assignment statements\indexii{assignment}{statement} are used to
class C: pass # a class with no methods (yet)
\end{verbatim}
+
\section{The \keyword{del} statement \label{del}}
\stindex{del}
right type (but even this is determined by the sliced object).
\indexii{attribute}{deletion}
+
\section{The \keyword{print} statement \label{print}}
\stindex{print}
first expression evaluates to \code{None}, then \code{sys.stdout} is
used as the file for output.
+
\section{The \keyword{return} statement \label{return}}
\stindex{return}
before really leaving the function.
\kwindex{finally}
+
\section{The \keyword{raise} statement \label{raise}}
\stindex{raise}
transparently in an except clause.
\obindex{traceback}
+
\section{The \keyword{break} statement \label{break}}
\stindex{break}
before really leaving the loop.
\kwindex{finally}
+
\section{The \keyword{continue} statement \label{continue}}
\stindex{continue}
\indexii{loop}{statement}
\kwindex{finally}
+
\section{The \keyword{import} statement \label{import}}
\stindex{import}
[XXX Also should mention __import__().]
\bifuncindex{__import__}
+
\section{The \keyword{global} statement \label{global}}
\stindex{global}
\bifuncindex{execfile}
\bifuncindex{compile}
+
\section{The \keyword{exec} statement \label{exec}}
\stindex{exec}
The formatting of the grammar rules in the following sections places
each clause on a separate line for clarity.
+
\section{The \keyword{if} statement\label{if}}
\stindex{if}
\kwindex{elif}
\kwindex{else}
+
\section{The \keyword{while} statement\label{while}}
\stindex{while}
\indexii{loop}{statement}
\stindex{break}
\stindex{continue}
+
\section{The \keyword{for} statement\label{for}}
\stindex{for}
\indexii{loop}{statement}
if x < 0: a.remove(x)
\end{verbatim}
+
\section{The \keyword{try} statement\label{try}}
\stindex{try}
\stindex{break}
\stindex{continue}
+
\section{Function definitions\label{function}}
\indexii{function}{definition}
function will change in Python 2.2. See the appendix for a
description of the new semantics.
+
\section{Class definitions\label{class}}
\indexii{class}{definition}
gives the syntax used in these cases.
\index{interpreter}
+
\section{Complete Python programs\label{programs}}
\index{program}
\index{command line}
\index{standard input}
+
\section{File input\label{file-input}}
All input read from non-interactive files has the same form:
\end{itemize}
+
\section{Interactive input\label{interactive}}
Input in interactive mode is parsed using the following grammar:
line in interactive mode; this is needed to help the parser detect the
end of the input.
+
\section{Expression input\label{expression-input}}
\index{input}