mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	Fix a bogus \code@...@ to be \code{...}.
Normalize some other markup.
This commit is contained in:
		
							parent
							
								
									744a662f36
								
							
						
					
					
						commit
						dde91f000a
					
				
					 2 changed files with 46 additions and 48 deletions
				
			
		| 
						 | 
					@ -196,9 +196,9 @@ messages.)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WARNING: Although the definition of assignment implies that overlaps
 | 
					WARNING: Although the definition of assignment implies that overlaps
 | 
				
			||||||
between the left-hand side and the right-hand side are `safe' (e.g.
 | 
					between the left-hand side and the right-hand side are `safe' (e.g.
 | 
				
			||||||
\verb@a, b = b, a@ swaps two variables), overlaps within the
 | 
					\code{a, b = b, a} swaps two variables), overlaps within the
 | 
				
			||||||
collection of assigned-to variables are not safe!  For instance, the
 | 
					collection of assigned-to variables are not safe!  For instance, the
 | 
				
			||||||
following program prints \code@[0, 2]@:
 | 
					following program prints \code{[0, 2]}:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
x = [0, 1]
 | 
					x = [0, 1]
 | 
				
			||||||
| 
						 | 
					@ -208,7 +208,7 @@ print x
 | 
				
			||||||
\end{verbatim}
 | 
					\end{verbatim}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt pass} statement}
 | 
					\section{The \keyword{pass} statement}
 | 
				
			||||||
\stindex{pass}
 | 
					\stindex{pass}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -226,7 +226,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 {\tt del} statement}
 | 
					\section{The \keyword{del} statement}
 | 
				
			||||||
\stindex{del}
 | 
					\stindex{del}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -254,7 +254,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 {\tt print} statement} \label{print}
 | 
					\section{The \keyword{print} statement} \label{print}
 | 
				
			||||||
\stindex{print}
 | 
					\stindex{print}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -269,21 +269,21 @@ space is written before each object is (converted and) written, unless
 | 
				
			||||||
the output system believes it is positioned at the beginning of a
 | 
					the output system believes it is positioned at the beginning of a
 | 
				
			||||||
line.  This is the case: (1) when no characters have yet been written
 | 
					line.  This is the case: (1) when no characters have yet been written
 | 
				
			||||||
to standard output; or (2) when the last character written to standard
 | 
					to standard output; or (2) when the last character written to standard
 | 
				
			||||||
output is \verb/\n/; or (3) when the last write operation on standard
 | 
					output is \character{\\n}; or (3) when the last write operation on standard
 | 
				
			||||||
output was not a \keyword{print} statement.  (In some cases it may be
 | 
					output was not a \keyword{print} statement.  (In some cases it may be
 | 
				
			||||||
functional to write an empty string to standard output for this
 | 
					functional to write an empty string to standard output for this
 | 
				
			||||||
reason.)
 | 
					reason.)
 | 
				
			||||||
\index{output}
 | 
					\index{output}
 | 
				
			||||||
\indexii{writing}{values}
 | 
					\indexii{writing}{values}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
A \verb/"\n"/ character is written at the end, unless the \keyword{print}
 | 
					A \character{\\n} character is written at the end, unless the \keyword{print}
 | 
				
			||||||
statement ends with a comma.  This is the only action if the statement
 | 
					statement ends with a comma.  This is the only action if the statement
 | 
				
			||||||
contains just the keyword \keyword{print}.
 | 
					contains just the keyword \keyword{print}.
 | 
				
			||||||
\indexii{trailing}{comma}
 | 
					\indexii{trailing}{comma}
 | 
				
			||||||
\indexii{newline}{suppression}
 | 
					\indexii{newline}{suppression}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Standard output is defined as the file object named \verb@stdout@
 | 
					Standard output is defined as the file object named \code{stdout}
 | 
				
			||||||
in the built-in module \verb@sys@.  If no such object exists,
 | 
					in the built-in module \module{sys}.  If no such object exists,
 | 
				
			||||||
or if it is not a writable file, a \exception{RuntimeError} exception is raised.
 | 
					or if it is not a writable file, a \exception{RuntimeError} exception is raised.
 | 
				
			||||||
(The original implementation attempts to write to the system's original
 | 
					(The original implementation attempts to write to the system's original
 | 
				
			||||||
standard output instead, but this is not safe, and should be fixed.)
 | 
					standard output instead, but this is not safe, and should be fixed.)
 | 
				
			||||||
| 
						 | 
					@ -292,7 +292,7 @@ standard output instead, but this is not safe, and should be fixed.)
 | 
				
			||||||
\ttindex{stdout}
 | 
					\ttindex{stdout}
 | 
				
			||||||
\exindex{RuntimeError}
 | 
					\exindex{RuntimeError}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt return} statement}
 | 
					\section{The \keyword{return} statement}
 | 
				
			||||||
\stindex{return}
 | 
					\stindex{return}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -315,7 +315,7 @@ with a finally clause, that finally clause is executed
 | 
				
			||||||
before really leaving the function.
 | 
					before really leaving the function.
 | 
				
			||||||
\kwindex{finally}
 | 
					\kwindex{finally}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt raise} statement}
 | 
					\section{The \keyword{raise} statement}
 | 
				
			||||||
\stindex{raise}
 | 
					\stindex{raise}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -346,7 +346,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 {\tt break} statement}
 | 
					\section{The \keyword{break} statement}
 | 
				
			||||||
\stindex{break}
 | 
					\stindex{break}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -373,7 +373,7 @@ with a finally clause, that finally clause is executed
 | 
				
			||||||
before really leaving the loop.
 | 
					before really leaving the loop.
 | 
				
			||||||
\kwindex{finally}
 | 
					\kwindex{finally}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt continue} statement}
 | 
					\section{The \keyword{continue} statement}
 | 
				
			||||||
\stindex{continue}
 | 
					\stindex{continue}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -383,7 +383,7 @@ continue_stmt:  "continue"
 | 
				
			||||||
\keyword{continue} may only occur syntactically nested in a \keyword{for} or
 | 
					\keyword{continue} may only occur syntactically nested in a \keyword{for} or
 | 
				
			||||||
\keyword{while} loop, but not nested in a function or class definition or
 | 
					\keyword{while} loop, but not nested in a function or class definition or
 | 
				
			||||||
\keyword{try} statement within that loop.\footnote{Except that it may
 | 
					\keyword{try} statement within that loop.\footnote{Except that it may
 | 
				
			||||||
currently occur within an {\tt except} clause.}
 | 
					currently occur within an except clause.}
 | 
				
			||||||
\stindex{for}
 | 
					\stindex{for}
 | 
				
			||||||
\stindex{while}
 | 
					\stindex{while}
 | 
				
			||||||
\indexii{loop}{statement}
 | 
					\indexii{loop}{statement}
 | 
				
			||||||
| 
						 | 
					@ -391,7 +391,7 @@ currently occur within an {\tt except} clause.}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
It continues with the next cycle of the nearest enclosing loop.
 | 
					It continues with the next cycle of the nearest enclosing loop.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt import} statement} \label{import}
 | 
					\section{The \keyword{import} statement} \label{import}
 | 
				
			||||||
\stindex{import}
 | 
					\stindex{import}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -427,9 +427,8 @@ path; it is initialized from the shell environment variable
 | 
				
			||||||
\indexii{built-in}{module}
 | 
					\indexii{built-in}{module}
 | 
				
			||||||
\indexii{user-defined}{module}
 | 
					\indexii{user-defined}{module}
 | 
				
			||||||
\refbimodindex{sys}
 | 
					\refbimodindex{sys}
 | 
				
			||||||
\ttindex{path}
 | 
					 | 
				
			||||||
\ttindex{sys.path}
 | 
					 | 
				
			||||||
\indexii{filename}{extension}
 | 
					\indexii{filename}{extension}
 | 
				
			||||||
 | 
					\indexiii{module}{search}{path}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If a built-in module is found, its built-in initialization code is
 | 
					If a built-in module is found, its built-in initialization code is
 | 
				
			||||||
executed and step (1) is finished.  If no matching file is found,
 | 
					executed and step (1) is finished.  If no matching file is found,
 | 
				
			||||||
| 
						 | 
					@ -454,8 +453,8 @@ module name: it goes through the list of identifiers, looks each one
 | 
				
			||||||
of them up in the module found in step (1), and binds the name in the
 | 
					of them up in the module found in step (1), and binds the name in the
 | 
				
			||||||
local name space to the object thus found.  If a name is not found,
 | 
					local name space to the object thus found.  If a name is not found,
 | 
				
			||||||
\exception{ImportError} is raised.  If the list of identifiers is replaced
 | 
					\exception{ImportError} is raised.  If the list of identifiers is replaced
 | 
				
			||||||
by a star (\verb@*@), all names defined in the module are bound,
 | 
					by a star (\code{*}), all names defined in the module are bound,
 | 
				
			||||||
except those beginning with an underscore(\verb@_@).
 | 
					except those beginning with an underscore(\code{_}).
 | 
				
			||||||
\indexii{name}{binding}
 | 
					\indexii{name}{binding}
 | 
				
			||||||
\exindex{ImportError}
 | 
					\exindex{ImportError}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -463,7 +462,7 @@ Names bound by import statements may not occur in \keyword{global}
 | 
				
			||||||
statements in the same scope.
 | 
					statements in the same scope.
 | 
				
			||||||
\stindex{global}
 | 
					\stindex{global}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The \keyword{from} form with \verb@*@ may only occur in a module scope.
 | 
					The \keyword{from} form with \code{*} may only occur in a module scope.
 | 
				
			||||||
\kwindex{from}
 | 
					\kwindex{from}
 | 
				
			||||||
\ttindex{from ... import *}
 | 
					\ttindex{from ... import *}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -472,7 +471,7 @@ restrictions, but programs should not abuse this freedom, as future
 | 
				
			||||||
implementations may enforce them or silently change the meaning of the
 | 
					implementations may enforce them or silently change the meaning of the
 | 
				
			||||||
program.)
 | 
					program.)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt global} statement} \label{global}
 | 
					\section{The \keyword{global} statement} \label{global}
 | 
				
			||||||
\stindex{global}
 | 
					\stindex{global}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -481,8 +480,8 @@ global_stmt:    "global" identifier ("," identifier)*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The \keyword{global} statement is a declaration which holds for the
 | 
					The \keyword{global} statement is a declaration which holds for the
 | 
				
			||||||
entire current code block.  It means that the listed identifiers are to be
 | 
					entire current code block.  It means that the listed identifiers are to be
 | 
				
			||||||
interpreted as globals.  While {\em using} global names is automatic
 | 
					interpreted as globals.  While \emph{using} global names is automatic
 | 
				
			||||||
if they are not defined in the local scope, {\em assigning} to global
 | 
					if they are not defined in the local scope, \emph{assigning} to global
 | 
				
			||||||
names would be impossible without \keyword{global}.
 | 
					names would be impossible without \keyword{global}.
 | 
				
			||||||
\indexiii{global}{name}{binding}
 | 
					\indexiii{global}{name}{binding}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -501,7 +500,7 @@ program.)
 | 
				
			||||||
Note: the \keyword{global} is a directive to the parser.  Therefore, it
 | 
					Note: the \keyword{global} is a directive to the parser.  Therefore, it
 | 
				
			||||||
applies only to code parsed at the same time as the \keyword{global}
 | 
					applies only to code parsed at the same time as the \keyword{global}
 | 
				
			||||||
statement.  In particular, a \keyword{global} statement contained in an
 | 
					statement.  In particular, a \keyword{global} statement contained in an
 | 
				
			||||||
\keyword{exec} statement does not affect the code block {\em containing}
 | 
					\keyword{exec} statement does not affect the code block \emph{containing}
 | 
				
			||||||
the \keyword{exec} statement, and code contained in an \keyword{exec}
 | 
					the \keyword{exec} statement, and code contained in an \keyword{exec}
 | 
				
			||||||
statement is unaffected by \keyword{global} statements in the code
 | 
					statement is unaffected by \keyword{global} statements in the code
 | 
				
			||||||
containing the \keyword{exec} statement.  The same applies to the
 | 
					containing the \keyword{exec} statement.  The same applies to the
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										47
									
								
								Doc/ref6.tex
									
										
									
									
									
								
							
							
						
						
									
										47
									
								
								Doc/ref6.tex
									
										
									
									
									
								
							| 
						 | 
					@ -196,9 +196,9 @@ messages.)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WARNING: Although the definition of assignment implies that overlaps
 | 
					WARNING: Although the definition of assignment implies that overlaps
 | 
				
			||||||
between the left-hand side and the right-hand side are `safe' (e.g.
 | 
					between the left-hand side and the right-hand side are `safe' (e.g.
 | 
				
			||||||
\verb@a, b = b, a@ swaps two variables), overlaps within the
 | 
					\code{a, b = b, a} swaps two variables), overlaps within the
 | 
				
			||||||
collection of assigned-to variables are not safe!  For instance, the
 | 
					collection of assigned-to variables are not safe!  For instance, the
 | 
				
			||||||
following program prints \code@[0, 2]@:
 | 
					following program prints \code{[0, 2]}:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
x = [0, 1]
 | 
					x = [0, 1]
 | 
				
			||||||
| 
						 | 
					@ -208,7 +208,7 @@ print x
 | 
				
			||||||
\end{verbatim}
 | 
					\end{verbatim}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt pass} statement}
 | 
					\section{The \keyword{pass} statement}
 | 
				
			||||||
\stindex{pass}
 | 
					\stindex{pass}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -226,7 +226,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 {\tt del} statement}
 | 
					\section{The \keyword{del} statement}
 | 
				
			||||||
\stindex{del}
 | 
					\stindex{del}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -254,7 +254,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 {\tt print} statement} \label{print}
 | 
					\section{The \keyword{print} statement} \label{print}
 | 
				
			||||||
\stindex{print}
 | 
					\stindex{print}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -269,21 +269,21 @@ space is written before each object is (converted and) written, unless
 | 
				
			||||||
the output system believes it is positioned at the beginning of a
 | 
					the output system believes it is positioned at the beginning of a
 | 
				
			||||||
line.  This is the case: (1) when no characters have yet been written
 | 
					line.  This is the case: (1) when no characters have yet been written
 | 
				
			||||||
to standard output; or (2) when the last character written to standard
 | 
					to standard output; or (2) when the last character written to standard
 | 
				
			||||||
output is \verb/\n/; or (3) when the last write operation on standard
 | 
					output is \character{\\n}; or (3) when the last write operation on standard
 | 
				
			||||||
output was not a \keyword{print} statement.  (In some cases it may be
 | 
					output was not a \keyword{print} statement.  (In some cases it may be
 | 
				
			||||||
functional to write an empty string to standard output for this
 | 
					functional to write an empty string to standard output for this
 | 
				
			||||||
reason.)
 | 
					reason.)
 | 
				
			||||||
\index{output}
 | 
					\index{output}
 | 
				
			||||||
\indexii{writing}{values}
 | 
					\indexii{writing}{values}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
A \verb/"\n"/ character is written at the end, unless the \keyword{print}
 | 
					A \character{\\n} character is written at the end, unless the \keyword{print}
 | 
				
			||||||
statement ends with a comma.  This is the only action if the statement
 | 
					statement ends with a comma.  This is the only action if the statement
 | 
				
			||||||
contains just the keyword \keyword{print}.
 | 
					contains just the keyword \keyword{print}.
 | 
				
			||||||
\indexii{trailing}{comma}
 | 
					\indexii{trailing}{comma}
 | 
				
			||||||
\indexii{newline}{suppression}
 | 
					\indexii{newline}{suppression}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Standard output is defined as the file object named \verb@stdout@
 | 
					Standard output is defined as the file object named \code{stdout}
 | 
				
			||||||
in the built-in module \verb@sys@.  If no such object exists,
 | 
					in the built-in module \module{sys}.  If no such object exists,
 | 
				
			||||||
or if it is not a writable file, a \exception{RuntimeError} exception is raised.
 | 
					or if it is not a writable file, a \exception{RuntimeError} exception is raised.
 | 
				
			||||||
(The original implementation attempts to write to the system's original
 | 
					(The original implementation attempts to write to the system's original
 | 
				
			||||||
standard output instead, but this is not safe, and should be fixed.)
 | 
					standard output instead, but this is not safe, and should be fixed.)
 | 
				
			||||||
| 
						 | 
					@ -292,7 +292,7 @@ standard output instead, but this is not safe, and should be fixed.)
 | 
				
			||||||
\ttindex{stdout}
 | 
					\ttindex{stdout}
 | 
				
			||||||
\exindex{RuntimeError}
 | 
					\exindex{RuntimeError}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt return} statement}
 | 
					\section{The \keyword{return} statement}
 | 
				
			||||||
\stindex{return}
 | 
					\stindex{return}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -315,7 +315,7 @@ with a finally clause, that finally clause is executed
 | 
				
			||||||
before really leaving the function.
 | 
					before really leaving the function.
 | 
				
			||||||
\kwindex{finally}
 | 
					\kwindex{finally}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt raise} statement}
 | 
					\section{The \keyword{raise} statement}
 | 
				
			||||||
\stindex{raise}
 | 
					\stindex{raise}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -346,7 +346,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 {\tt break} statement}
 | 
					\section{The \keyword{break} statement}
 | 
				
			||||||
\stindex{break}
 | 
					\stindex{break}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -373,7 +373,7 @@ with a finally clause, that finally clause is executed
 | 
				
			||||||
before really leaving the loop.
 | 
					before really leaving the loop.
 | 
				
			||||||
\kwindex{finally}
 | 
					\kwindex{finally}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt continue} statement}
 | 
					\section{The \keyword{continue} statement}
 | 
				
			||||||
\stindex{continue}
 | 
					\stindex{continue}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -383,7 +383,7 @@ continue_stmt:  "continue"
 | 
				
			||||||
\keyword{continue} may only occur syntactically nested in a \keyword{for} or
 | 
					\keyword{continue} may only occur syntactically nested in a \keyword{for} or
 | 
				
			||||||
\keyword{while} loop, but not nested in a function or class definition or
 | 
					\keyword{while} loop, but not nested in a function or class definition or
 | 
				
			||||||
\keyword{try} statement within that loop.\footnote{Except that it may
 | 
					\keyword{try} statement within that loop.\footnote{Except that it may
 | 
				
			||||||
currently occur within an {\tt except} clause.}
 | 
					currently occur within an except clause.}
 | 
				
			||||||
\stindex{for}
 | 
					\stindex{for}
 | 
				
			||||||
\stindex{while}
 | 
					\stindex{while}
 | 
				
			||||||
\indexii{loop}{statement}
 | 
					\indexii{loop}{statement}
 | 
				
			||||||
| 
						 | 
					@ -391,7 +391,7 @@ currently occur within an {\tt except} clause.}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
It continues with the next cycle of the nearest enclosing loop.
 | 
					It continues with the next cycle of the nearest enclosing loop.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt import} statement} \label{import}
 | 
					\section{The \keyword{import} statement} \label{import}
 | 
				
			||||||
\stindex{import}
 | 
					\stindex{import}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -427,9 +427,8 @@ path; it is initialized from the shell environment variable
 | 
				
			||||||
\indexii{built-in}{module}
 | 
					\indexii{built-in}{module}
 | 
				
			||||||
\indexii{user-defined}{module}
 | 
					\indexii{user-defined}{module}
 | 
				
			||||||
\refbimodindex{sys}
 | 
					\refbimodindex{sys}
 | 
				
			||||||
\ttindex{path}
 | 
					 | 
				
			||||||
\ttindex{sys.path}
 | 
					 | 
				
			||||||
\indexii{filename}{extension}
 | 
					\indexii{filename}{extension}
 | 
				
			||||||
 | 
					\indexiii{module}{search}{path}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If a built-in module is found, its built-in initialization code is
 | 
					If a built-in module is found, its built-in initialization code is
 | 
				
			||||||
executed and step (1) is finished.  If no matching file is found,
 | 
					executed and step (1) is finished.  If no matching file is found,
 | 
				
			||||||
| 
						 | 
					@ -454,8 +453,8 @@ module name: it goes through the list of identifiers, looks each one
 | 
				
			||||||
of them up in the module found in step (1), and binds the name in the
 | 
					of them up in the module found in step (1), and binds the name in the
 | 
				
			||||||
local name space to the object thus found.  If a name is not found,
 | 
					local name space to the object thus found.  If a name is not found,
 | 
				
			||||||
\exception{ImportError} is raised.  If the list of identifiers is replaced
 | 
					\exception{ImportError} is raised.  If the list of identifiers is replaced
 | 
				
			||||||
by a star (\verb@*@), all names defined in the module are bound,
 | 
					by a star (\code{*}), all names defined in the module are bound,
 | 
				
			||||||
except those beginning with an underscore(\verb@_@).
 | 
					except those beginning with an underscore(\code{_}).
 | 
				
			||||||
\indexii{name}{binding}
 | 
					\indexii{name}{binding}
 | 
				
			||||||
\exindex{ImportError}
 | 
					\exindex{ImportError}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -463,7 +462,7 @@ Names bound by import statements may not occur in \keyword{global}
 | 
				
			||||||
statements in the same scope.
 | 
					statements in the same scope.
 | 
				
			||||||
\stindex{global}
 | 
					\stindex{global}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The \keyword{from} form with \verb@*@ may only occur in a module scope.
 | 
					The \keyword{from} form with \code{*} may only occur in a module scope.
 | 
				
			||||||
\kwindex{from}
 | 
					\kwindex{from}
 | 
				
			||||||
\ttindex{from ... import *}
 | 
					\ttindex{from ... import *}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -472,7 +471,7 @@ restrictions, but programs should not abuse this freedom, as future
 | 
				
			||||||
implementations may enforce them or silently change the meaning of the
 | 
					implementations may enforce them or silently change the meaning of the
 | 
				
			||||||
program.)
 | 
					program.)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\section{The {\tt global} statement} \label{global}
 | 
					\section{The \keyword{global} statement} \label{global}
 | 
				
			||||||
\stindex{global}
 | 
					\stindex{global}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\begin{verbatim}
 | 
					\begin{verbatim}
 | 
				
			||||||
| 
						 | 
					@ -481,8 +480,8 @@ global_stmt:    "global" identifier ("," identifier)*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The \keyword{global} statement is a declaration which holds for the
 | 
					The \keyword{global} statement is a declaration which holds for the
 | 
				
			||||||
entire current code block.  It means that the listed identifiers are to be
 | 
					entire current code block.  It means that the listed identifiers are to be
 | 
				
			||||||
interpreted as globals.  While {\em using} global names is automatic
 | 
					interpreted as globals.  While \emph{using} global names is automatic
 | 
				
			||||||
if they are not defined in the local scope, {\em assigning} to global
 | 
					if they are not defined in the local scope, \emph{assigning} to global
 | 
				
			||||||
names would be impossible without \keyword{global}.
 | 
					names would be impossible without \keyword{global}.
 | 
				
			||||||
\indexiii{global}{name}{binding}
 | 
					\indexiii{global}{name}{binding}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -501,7 +500,7 @@ program.)
 | 
				
			||||||
Note: the \keyword{global} is a directive to the parser.  Therefore, it
 | 
					Note: the \keyword{global} is a directive to the parser.  Therefore, it
 | 
				
			||||||
applies only to code parsed at the same time as the \keyword{global}
 | 
					applies only to code parsed at the same time as the \keyword{global}
 | 
				
			||||||
statement.  In particular, a \keyword{global} statement contained in an
 | 
					statement.  In particular, a \keyword{global} statement contained in an
 | 
				
			||||||
\keyword{exec} statement does not affect the code block {\em containing}
 | 
					\keyword{exec} statement does not affect the code block \emph{containing}
 | 
				
			||||||
the \keyword{exec} statement, and code contained in an \keyword{exec}
 | 
					the \keyword{exec} statement, and code contained in an \keyword{exec}
 | 
				
			||||||
statement is unaffected by \keyword{global} statements in the code
 | 
					statement is unaffected by \keyword{global} statements in the code
 | 
				
			||||||
containing the \keyword{exec} statement.  The same applies to the
 | 
					containing the \keyword{exec} statement.  The same applies to the
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue