Kaydet (Commit) 2829f1cf authored tarafından Fred Drake's avatar Fred Drake

Fix a very minor (but annoying when looking for things!) markup nit.

üst 8c963695
...@@ -33,6 +33,7 @@ standard modules. These are not documented here, but in the separate ...@@ -33,6 +33,7 @@ standard modules. These are not documented here, but in the separate
built-in modules are mentioned when they interact in a significant way built-in modules are mentioned when they interact in a significant way
with the language definition. with the language definition.
\section{Notation\label{notation}} \section{Notation\label{notation}}
The descriptions of lexical analysis and syntax use a modified BNF The descriptions of lexical analysis and syntax use a modified BNF
......
\chapter{Data model\label{datamodel}} \chapter{Data model\label{datamodel}}
\section{Objects, values and types\label{objects}} \section{Objects, values and types\label{objects}}
\dfn{Objects} are Python's abstraction for data. All data in a Python \dfn{Objects} are Python's abstraction for data. All data in a Python
...@@ -95,6 +96,7 @@ lists. ...@@ -95,6 +96,7 @@ lists.
(Note that \samp{c = d = []} assigns the same object to both (Note that \samp{c = d = []} assigns the same object to both
\code{c} and \code{d}.) \code{c} and \code{d}.)
\section{The standard type hierarchy\label{types}} \section{The standard type hierarchy\label{types}}
Below is a list of the types that are built into Python. Extension Below is a list of the types that are built into Python. Extension
......
\chapter{Execution model \label{execmodel}} \chapter{Execution model \label{execmodel}}
\index{execution model} \index{execution model}
\section{Code blocks, execution frames, and namespaces \label{execframes}} \section{Code blocks, execution frames, and namespaces \label{execframes}}
\index{code block} \index{code block}
\index{namespace} \index{namespace}
......
...@@ -16,6 +16,7 @@ and no semantics are given, the semantics of this form of \code{name} ...@@ -16,6 +16,7 @@ and no semantics are given, the semantics of this form of \code{name}
are the same as for \code{othername}. are the same as for \code{othername}.
\index{syntax} \index{syntax}
\section{Arithmetic conversions\label{conversions}} \section{Arithmetic conversions\label{conversions}}
\indexii{arithmetic}{conversion} \indexii{arithmetic}{conversion}
...@@ -54,6 +55,7 @@ atom: identifier | literal | enclosure ...@@ -54,6 +55,7 @@ atom: identifier | literal | enclosure
enclosure: parenth_form|list_display|dict_display|string_conversion enclosure: parenth_form|list_display|dict_display|string_conversion
\end{verbatim} \end{verbatim}
\subsection{Identifiers (Names)\label{atom-identifiers}} \subsection{Identifiers (Names)\label{atom-identifiers}}
\index{name} \index{name}
\index{identifier} \index{identifier}
...@@ -99,6 +101,7 @@ transformed name is extremely long (longer than 255 characters), ...@@ -99,6 +101,7 @@ transformed name is extremely long (longer than 255 characters),
implementation defined truncation may happen. If the class name implementation defined truncation may happen. If the class name
consists only of underscores, no transformation is done. consists only of underscores, no transformation is done.
\subsection{Literals\label{atom-literals}} \subsection{Literals\label{atom-literals}}
\index{literal} \index{literal}
...@@ -122,6 +125,7 @@ the same object or a different object with the same value. ...@@ -122,6 +125,7 @@ the same object or a different object with the same value.
\indexiii{immutable}{data}{type} \indexiii{immutable}{data}{type}
\indexii{immutable}{object} \indexii{immutable}{object}
\subsection{Parenthesized forms\label{parenthesized}} \subsection{Parenthesized forms\label{parenthesized}}
\index{parenthesized form} \index{parenthesized form}
...@@ -150,6 +154,7 @@ pass uncaught. ...@@ -150,6 +154,7 @@ pass uncaught.
\index{comma} \index{comma}
\indexii{tuple}{display} \indexii{tuple}{display}
\subsection{List displays\label{lists}} \subsection{List displays\label{lists}}
\indexii{list}{display} \indexii{list}{display}
\indexii{list}{comprehensions} \indexii{list}{comprehensions}
...@@ -181,6 +186,7 @@ each time the innermost block is reached. ...@@ -181,6 +186,7 @@ each time the innermost block is reached.
\obindex{list} \obindex{list}
\indexii{empty}{list} \indexii{empty}{list}
\subsection{Dictionary displays\label{dict}} \subsection{Dictionary displays\label{dict}}
\indexii{dictionary}{display} \indexii{dictionary}{display}
...@@ -210,6 +216,7 @@ are not detected; the last datum (textually rightmost in the display) ...@@ -210,6 +216,7 @@ are not detected; the last datum (textually rightmost in the display)
stored for a given key value prevails. stored for a given key value prevails.
\indexii{immutable}{object} \indexii{immutable}{object}
\subsection{String conversions\label{string-conversions}} \subsection{String conversions\label{string-conversions}}
\indexii{string}{conversion} \indexii{string}{conversion}
\indexii{reverse}{quotes} \indexii{reverse}{quotes}
...@@ -249,6 +256,7 @@ similar but more user-friendly conversion. ...@@ -249,6 +256,7 @@ similar but more user-friendly conversion.
\bifuncindex{repr} \bifuncindex{repr}
\bifuncindex{str} \bifuncindex{str}
\section{Primaries\label{primaries}} \section{Primaries\label{primaries}}
\index{primary} \index{primary}
...@@ -259,6 +267,7 @@ Their syntax is: ...@@ -259,6 +267,7 @@ Their syntax is:
primary: atom | attributeref | subscription | slicing | call primary: atom | attributeref | subscription | slicing | call
\end{verbatim} \end{verbatim}
\subsection{Attribute references\label{attribute-references}} \subsection{Attribute references\label{attribute-references}}
\indexii{attribute}{reference} \indexii{attribute}{reference}
...@@ -279,6 +288,7 @@ yield different objects. ...@@ -279,6 +288,7 @@ yield different objects.
\obindex{module} \obindex{module}
\obindex{list} \obindex{list}
\subsection{Subscriptions\label{subscriptions}} \subsection{Subscriptions\label{subscriptions}}
\index{subscription} \index{subscription}
...@@ -316,6 +326,7 @@ type but a string of exactly one character. ...@@ -316,6 +326,7 @@ type but a string of exactly one character.
\index{character} \index{character}
\indexii{string}{item} \indexii{string}{item}
\subsection{Slicings\label{slicings}} \subsection{Slicings\label{slicings}}
\index{slicing} \index{slicing}
\index{slice} \index{slice}
...@@ -382,6 +393,7 @@ expressions. ...@@ -382,6 +393,7 @@ expressions.
\withsubitem{(slice object attribute)}{\ttindex{start} \withsubitem{(slice object attribute)}{\ttindex{start}
\ttindex{stop}\ttindex{step}} \ttindex{stop}\ttindex{step}}
\subsection{Calls\label{calls}} \subsection{Calls\label{calls}}
\index{call} \index{call}
...@@ -556,6 +568,7 @@ In all three cases, if the argument does not have the proper type, ...@@ -556,6 +568,7 @@ In all three cases, if the argument does not have the proper type,
a \exception{TypeError} exception is raised. a \exception{TypeError} exception is raised.
\exindex{TypeError} \exindex{TypeError}
\section{Binary arithmetic operations\label{binary}} \section{Binary arithmetic operations\label{binary}}
\indexiii{binary}{arithmetic}{operation} \indexiii{binary}{arithmetic}{operation}
...@@ -626,6 +639,7 @@ arguments. The numeric arguments are first converted to a common ...@@ -626,6 +639,7 @@ arguments. The numeric arguments are first converted to a common
type. type.
\index{subtraction} \index{subtraction}
\section{Shifting operations\label{shifting}} \section{Shifting operations\label{shifting}}
\indexii{shifting}{operation} \indexii{shifting}{operation}
...@@ -650,6 +664,7 @@ value. Negative shift counts raise a \exception{ValueError} ...@@ -650,6 +664,7 @@ value. Negative shift counts raise a \exception{ValueError}
exception. exception.
\exindex{ValueError} \exindex{ValueError}
\section{Binary bit-wise operations\label{bitwise}} \section{Binary bit-wise operations\label{bitwise}}
\indexiii{binary}{bit-wise}{operation} \indexiii{binary}{bit-wise}{operation}
...@@ -678,6 +693,7 @@ converted to a common type. ...@@ -678,6 +693,7 @@ converted to a common type.
\indexii{bit-wise}{or} \indexii{bit-wise}{or}
\indexii{inclusive}{or} \indexii{inclusive}{or}
\section{Comparisons\label{comparisons}} \section{Comparisons\label{comparisons}}
\index{comparison} \index{comparison}
...@@ -808,6 +824,7 @@ truth value. ...@@ -808,6 +824,7 @@ truth value.
\opindex{is not} \opindex{is not}
\indexii{identity}{test} \indexii{identity}{test}
\section{Boolean operations\label{Booleans}} \section{Boolean operations\label{Booleans}}
\indexii{Boolean}{operation} \indexii{Boolean}{operation}
......
...@@ -22,6 +22,7 @@ simple_stmt: expression_stmt ...@@ -22,6 +22,7 @@ simple_stmt: expression_stmt
| exec_stmt | exec_stmt
\end{verbatim} \end{verbatim}
\section{Expression statements \label{exprstmts}} \section{Expression statements \label{exprstmts}}
\indexii{expression}{statement} \indexii{expression}{statement}
...@@ -52,6 +53,7 @@ any output.) ...@@ -52,6 +53,7 @@ any output.)
\indexii{writing}{values} \indexii{writing}{values}
\indexii{procedure}{call} \indexii{procedure}{call}
\section{Assert statements \label{assert}} \section{Assert statements \label{assert}}
Assert statements\stindex{assert} are a convenient way to insert Assert statements\stindex{assert} are a convenient way to insert
...@@ -89,6 +91,7 @@ it will be displayed as part of the stack trace. ...@@ -89,6 +91,7 @@ it will be displayed as part of the stack trace.
Assignments to \code{__debug__} are illegal. The value for the Assignments to \code{__debug__} are illegal. The value for the
built-in variable is determined when the interpreter starts. built-in variable is determined when the interpreter starts.
\section{Assignment statements \label{assignment}} \section{Assignment statements \label{assignment}}
Assignment statements\indexii{assignment}{statement} are used to Assignment statements\indexii{assignment}{statement} are used to
...@@ -306,6 +309,7 @@ def f(arg): pass # a function that does nothing (yet) ...@@ -306,6 +309,7 @@ def f(arg): pass # a function that does nothing (yet)
class C: pass # a class with no methods (yet) class C: pass # a class with no methods (yet)
\end{verbatim} \end{verbatim}
\section{The \keyword{del} statement \label{del}} \section{The \keyword{del} statement \label{del}}
\stindex{del} \stindex{del}
...@@ -334,6 +338,7 @@ is in general equivalent to assignment of an empty slice of the ...@@ -334,6 +338,7 @@ is in general equivalent to assignment of an empty slice of the
right type (but even this is determined by the sliced object). right type (but even this is determined by the sliced object).
\indexii{attribute}{deletion} \indexii{attribute}{deletion}
\section{The \keyword{print} statement \label{print}} \section{The \keyword{print} statement \label{print}}
\stindex{print} \stindex{print}
...@@ -385,6 +390,7 @@ the subsequent expressions are printed to this file object. If the ...@@ -385,6 +390,7 @@ the subsequent expressions are printed to this file object. If the
first expression evaluates to \code{None}, then \code{sys.stdout} is first expression evaluates to \code{None}, then \code{sys.stdout} is
used as the file for output. used as the file for output.
\section{The \keyword{return} statement \label{return}} \section{The \keyword{return} statement \label{return}}
\stindex{return} \stindex{return}
...@@ -408,6 +414,7 @@ with a \keyword{finally} clause, that \keyword{finally} clause is executed ...@@ -408,6 +414,7 @@ with a \keyword{finally} clause, that \keyword{finally} clause is executed
before really leaving the function. before really leaving the function.
\kwindex{finally} \kwindex{finally}
\section{The \keyword{raise} statement \label{raise}} \section{The \keyword{raise} statement \label{raise}}
\stindex{raise} \stindex{raise}
...@@ -448,6 +455,7 @@ exception occurred. This is useful to re-raise an exception ...@@ -448,6 +455,7 @@ exception occurred. This is useful to re-raise an exception
transparently in an except clause. transparently in an except clause.
\obindex{traceback} \obindex{traceback}
\section{The \keyword{break} statement \label{break}} \section{The \keyword{break} statement \label{break}}
\stindex{break} \stindex{break}
...@@ -475,6 +483,7 @@ with a \keyword{finally} clause, that \keyword{finally} clause is executed ...@@ -475,6 +483,7 @@ with a \keyword{finally} clause, that \keyword{finally} clause is executed
before really leaving the loop. before really leaving the loop.
\kwindex{finally} \kwindex{finally}
\section{The \keyword{continue} statement \label{continue}} \section{The \keyword{continue} statement \label{continue}}
\stindex{continue} \stindex{continue}
...@@ -494,6 +503,7 @@ It continues with the next cycle of the nearest enclosing loop. ...@@ -494,6 +503,7 @@ It continues with the next cycle of the nearest enclosing loop.
\indexii{loop}{statement} \indexii{loop}{statement}
\kwindex{finally} \kwindex{finally}
\section{The \keyword{import} statement \label{import}} \section{The \keyword{import} statement \label{import}}
\stindex{import} \stindex{import}
...@@ -594,6 +604,7 @@ about how the module search works from inside a package.] ...@@ -594,6 +604,7 @@ about how the module search works from inside a package.]
[XXX Also should mention __import__().] [XXX Also should mention __import__().]
\bifuncindex{__import__} \bifuncindex{__import__}
\section{The \keyword{global} statement \label{global}} \section{The \keyword{global} statement \label{global}}
\stindex{global} \stindex{global}
...@@ -634,6 +645,7 @@ containing the \keyword{exec} statement. The same applies to the ...@@ -634,6 +645,7 @@ containing the \keyword{exec} statement. The same applies to the
\bifuncindex{execfile} \bifuncindex{execfile}
\bifuncindex{compile} \bifuncindex{compile}
\section{The \keyword{exec} statement \label{exec}} \section{The \keyword{exec} statement \label{exec}}
\stindex{exec} \stindex{exec}
......
...@@ -60,6 +60,7 @@ statement, thus there are no ambiguities (the `dangling ...@@ -60,6 +60,7 @@ statement, thus there are no ambiguities (the `dangling
The formatting of the grammar rules in the following sections places The formatting of the grammar rules in the following sections places
each clause on a separate line for clarity. each clause on a separate line for clarity.
\section{The \keyword{if} statement\label{if}} \section{The \keyword{if} statement\label{if}}
\stindex{if} \stindex{if}
...@@ -80,6 +81,7 @@ present, is executed. ...@@ -80,6 +81,7 @@ present, is executed.
\kwindex{elif} \kwindex{elif}
\kwindex{else} \kwindex{else}
\section{The \keyword{while} statement\label{while}} \section{The \keyword{while} statement\label{while}}
\stindex{while} \stindex{while}
\indexii{loop}{statement} \indexii{loop}{statement}
...@@ -105,6 +107,7 @@ of the suite and goes back to testing the expression. ...@@ -105,6 +107,7 @@ of the suite and goes back to testing the expression.
\stindex{break} \stindex{break}
\stindex{continue} \stindex{continue}
\section{The \keyword{for} statement\label{for}} \section{The \keyword{for} statement\label{for}}
\stindex{for} \stindex{for}
\indexii{loop}{statement} \indexii{loop}{statement}
...@@ -169,6 +172,7 @@ for x in a[:]: ...@@ -169,6 +172,7 @@ for x in a[:]:
if x < 0: a.remove(x) if x < 0: a.remove(x)
\end{verbatim} \end{verbatim}
\section{The \keyword{try} statement\label{try}} \section{The \keyword{try} statement\label{try}}
\stindex{try} \stindex{try}
...@@ -278,6 +282,7 @@ restriction may be lifted in the future). ...@@ -278,6 +282,7 @@ restriction may be lifted in the future).
\stindex{break} \stindex{break}
\stindex{continue} \stindex{continue}
\section{Function definitions\label{function}} \section{Function definitions\label{function}}
\indexii{function}{definition} \indexii{function}{definition}
...@@ -368,6 +373,7 @@ passed around. The semantics of name resolution in the nested ...@@ -368,6 +373,7 @@ passed around. The semantics of name resolution in the nested
function will change in Python 2.2. See the appendix for a function will change in Python 2.2. See the appendix for a
description of the new semantics. description of the new semantics.
\section{Class definitions\label{class}} \section{Class definitions\label{class}}
\indexii{class}{definition} \indexii{class}{definition}
......
...@@ -6,6 +6,7 @@ typed in interactively, from a module source file, etc. This chapter ...@@ -6,6 +6,7 @@ typed in interactively, from a module source file, etc. This chapter
gives the syntax used in these cases. gives the syntax used in these cases.
\index{interpreter} \index{interpreter}
\section{Complete Python programs\label{programs}} \section{Complete Python programs\label{programs}}
\index{program} \index{program}
...@@ -43,6 +44,7 @@ program. ...@@ -43,6 +44,7 @@ program.
\index{command line} \index{command line}
\index{standard input} \index{standard input}
\section{File input\label{file-input}} \section{File input\label{file-input}}
All input read from non-interactive files has the same form: All input read from non-interactive files has the same form:
...@@ -63,6 +65,7 @@ This syntax is used in the following situations: ...@@ -63,6 +65,7 @@ This syntax is used in the following situations:
\end{itemize} \end{itemize}
\section{Interactive input\label{interactive}} \section{Interactive input\label{interactive}}
Input in interactive mode is parsed using the following grammar: Input in interactive mode is parsed using the following grammar:
...@@ -75,6 +78,7 @@ Note that a (top-level) compound statement must be followed by a blank ...@@ -75,6 +78,7 @@ Note that a (top-level) compound statement must be followed by a blank
line in interactive mode; this is needed to help the parser detect the line in interactive mode; this is needed to help the parser detect the
end of the input. end of the input.
\section{Expression input\label{expression-input}} \section{Expression input\label{expression-input}}
\index{input} \index{input}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment