\contentsline {chapter}{\numberline {1}Introduction}{1}
\contentsline {section}{\numberline {1.1}Notation}{1}
\contentsline {chapter}{\numberline {2}Lexical analysis}{3}
\contentsline {section}{\numberline {2.1}Line structure}{3}
\contentsline {subsection}{\numberline {2.1.1}Comments}{3}
\contentsline {subsection}{\numberline {2.1.2}Explicit line joining}{3}
\contentsline {subsection}{\numberline {2.1.3}Implicit line joining}{4}
\contentsline {subsection}{\numberline {2.1.4}Blank lines}{4}
\contentsline {subsection}{\numberline {2.1.5}Indentation}{4}
\contentsline {section}{\numberline {2.2}Other tokens}{5}
\contentsline {section}{\numberline {2.3}Identifiers}{5}
\contentsline {subsection}{\numberline {2.3.1}Keywords}{6}
\contentsline {section}{\numberline {2.4}Literals}{6}
\contentsline {subsection}{\numberline {2.4.1}String literals}{6}
\contentsline {subsection}{\numberline {2.4.2}Numeric literals}{7}
\contentsline {section}{\numberline {2.5}Operators}{8}
\contentsline {section}{\numberline {2.6}Delimiters}{9}
\contentsline {chapter}{\numberline {3}Data model}{10}
\contentsline {section}{\numberline {3.1}Objects, values and types}{10}
\contentsline {section}{\numberline {3.2}The standard type hierarchy}{11}
\contentsline {section}{\numberline {3.3}Special method names}{16}
\contentsline {subsection}{\numberline {3.3.1}Special methods for any type}{16}
\contentsline {subsection}{\numberline {3.3.2}Special methods for attribute access}{17}
\contentsline {subsection}{\numberline {3.3.3}Special methods for sequence and mapping types}{18}
\contentsline {subsection}{\numberline {3.3.4}Special methods for sequence types}{18}
\contentsline {subsection}{\numberline {3.3.5}Special methods for numeric types}{18}
\contentsline {chapter}{\numberline {4}Execution model}{20}
\contentsline {section}{\numberline {4.1}Code blocks, execution frames, and name spaces}{20}
\contentsline {section}{\numberline {4.2}Exceptions}{22}
\contentsline {chapter}{\numberline {5}Expressions and conditions}{23}
\contentsline {section}{\numberline {5.1}Arithmetic conversions}{23}
\contentsline {section}{\numberline {5.2}Atoms}{24}
\contentsline {subsection}{\numberline {5.2.1}Identifiers (Names)}{24}
\contentsline {subsection}{\numberline {5.2.2}Literals}{24}
\contentsline {subsection}{\numberline {5.2.3}Parenthesized forms}{25}
\contentsline {subsection}{\numberline {5.2.4}List displays}{25}
\contentsline {subsection}{\numberline {5.2.5}Dictionary displays}{25}
\contentsline {subsection}{\numberline {5.2.6}String conversions}{26}
\contentsline {section}{\numberline {5.3}Primaries}{26}
\contentsline {subsection}{\numberline {5.3.1}Attribute references}{26}
\contentsline {subsection}{\numberline {5.3.2}Subscriptions}{26}
\contentsline {subsection}{\numberline {5.3.3}Slicings}{27}
\contentsline {subsection}{\numberline {5.3.4}Calls}{27}
\contentsline {section}{\numberline {5.4}Unary arithmetic operations}{28}
\contentsline {section}{\numberline {5.5}Binary arithmetic operations}{28}
\contentsline {section}{\numberline {5.6}Shifting operations}{29}
\contentsline {section}{\numberline {5.7}Binary bit-wise operations}{30}
\contentsline {section}{\numberline {5.8}Comparisons}{30}
\contentsline {section}{\numberline {5.9}Boolean operations}{31}
\contentsline {section}{\numberline {5.10}Expression lists and condition lists}{32}
\contentsline {chapter}{\numberline {6}Simple statements}{33}
\contentsline {section}{\numberline {6.1}Expression statements}{33}
\contentsline {section}{\numberline {6.2}Assignment statements}{34}
\contentsline {section}{\numberline {6.3}The {\ptt pass} statement}{36}
\contentsline {section}{\numberline {6.4}The {\ptt del} statement}{36}
\contentsline {section}{\numberline {6.5}The {\ptt print} statement}{36}
\contentsline {section}{\numberline {6.6}The {\ptt return} statement}{37}
\contentsline {section}{\numberline {6.7}The {\ptt raise} statement}{37}
\contentsline {section}{\numberline {6.8}The {\ptt break} statement}{38}
\contentsline {section}{\numberline {6.9}The {\ptt continue} statement}{38}
\contentsline {section}{\numberline {6.10}The {\ptt import} statement}{38}
\contentsline {section}{\numberline {6.11}The {\ptt global} statement}{39}
\contentsline {section}{\numberline {6.12}The {\ptt access} statement}{40}
\contentsline {section}{\numberline {6.13}The {\ptt exec} statement}{40}
\contentsline {chapter}{\numberline {7}Compound statements}{41}
\contentsline {section}{\numberline {7.1}The {\ptt if} statement}{42}
\contentsline {section}{\numberline {7.2}The {\ptt while} statement}{42}
\contentsline {section}{\numberline {7.3}The {\ptt for} statement}{43}
\contentsline {section}{\numberline {7.4}The {\ptt try} statement}{43}
\contentsline {section}{\numberline {7.5}Function definitions}{45}
\contentsline {section}{\numberline {7.6}Class definitions}{46}
\contentsline {chapter}{\numberline {8}Top-level components}{47}
\contentsline {section}{\numberline {8.1}Complete Python programs}{47}
\contentsline {section}{\numberline {8.2}File input}{47}
\contentsline {section}{\numberline {8.3}Interactive input}{48}
\contentsline {section}{\numberline {8.4}Expression input}{48}
