@@ -24,9 +24,9 @@ \section{Code blocks, execution frames, and namespaces \label{execframes}}
2424`\strong {-c}' option) is a code block. The file read by the built-in
2525function \function {execfile()} is a code block. The string argument
2626passed to the built-in function \function {eval()} and to the
27- \keyword {exec} statement is a code block. And finally, the expression
28- read and evaluated by the built-in function \function {input()} is a
29- code block.
27+ \keyword {exec}\stindex {exec} statement is a code block. And finally,
28+ the expression read and evaluated by the built-in function
29+ \function {input()} is a code block.
3030
3131A code block is executed in an execution frame. An \dfn {execution
3232frame}\indexii {execution}{frame} contains some administrative
@@ -86,20 +86,21 @@ \section{Code blocks, execution frames, and namespaces \label{execframes}}
8686
8787Whether a name is local or global in a code block is determined by
8888static inspection of the source text for the code block: in the
89- absence of \keyword {global} statements, a name that is bound anywhere
90- in the code block is local in the entire code block; all other names
91- are considered global. The \keyword {global} statement forces global
92- interpretation of selected names throughout the code block.
89+ absence of \keyword {global}\stindex {global} statements, a name that is
90+ bound anywhere in the code block is local in the entire code block;
91+ all other names are considered global. The \keyword {global} statement
92+ forces global interpretation of selected names throughout the code
93+ block.
9394
9495The following constructs bind names: formal parameters to functions,
9596\keyword {import} statements, class and function definitions (these
9697bind the class or function name in the defining block), and targets
9798that are identifiers if occurring in an assignment, \keyword {for} loop
9899header, or in the second position of an \keyword {except} clause
99100header. The \keyword {import} statement of the form `` \samp {from
100- \ldots import *}'' binds all names defined in the imported module,
101- except those beginning with an underscore. This form may only be used
102- at the module level.
101+ \ldots import *}'' \stindex {from} binds all names defined in the
102+ imported module, except those beginning with an underscore. This form
103+ may only be used at the module level.
103104
104105A target occurring in a \keyword {del} statement is also considered bound
105106for this purpose (though the actual semantics are to unbind the
@@ -110,15 +111,12 @@ \section{Code blocks, execution frames, and namespaces \label{execframes}}
110111searched in the built-in namespace (which is actually the global
111112namespace of the module \module {__builtin__}\refbimodindex {__builtin__}).
112113The built-in namespace associated with the execution of a code block
113- is actually found by looking up the name \code {__builtins__} is its
114+ is actually found by looking up the name \code {__builtins__} in its
114115global namespace; this should be a dictionary or a module (in the
115- latter case its dictionary is used). Normally, the
116+ latter case the module's dictionary is used). Normally, the
116117\code {__builtins__} namespace is the dictionary of the built-in module
117118\module {__builtin__} (note: no `s'). If it isn't, restricted
118119execution\indexii {restricted}{execution} mode is in effect.
119- \stindex {from}
120- \stindex {exec}
121- \stindex {global}
122120
123121The namespace for a module is automatically created the first time a
124122module is imported. The main module for a script is always called
0 commit comments