Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 667c9e4

Browse files
committed
Minor markup adjustments.
Move some index entries next to what they are referring to for better "targetting".
1 parent 844bd5b commit 667c9e4

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

Doc/ref/ref4.tex

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2525
function \function{execfile()} is a code block. The string argument
2626
passed 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

3131
A code block is executed in an execution frame. An \dfn{execution
3232
frame}\indexii{execution}{frame} contains some administrative
@@ -86,20 +86,21 @@ \section{Code blocks, execution frames, and namespaces \label{execframes}}
8686

8787
Whether a name is local or global in a code block is determined by
8888
static 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

9495
The following constructs bind names: formal parameters to functions,
9596
\keyword{import} statements, class and function definitions (these
9697
bind the class or function name in the defining block), and targets
9798
that are identifiers if occurring in an assignment, \keyword{for} loop
9899
header, or in the second position of an \keyword{except} clause
99100
header. 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

104105
A target occurring in a \keyword{del} statement is also considered bound
105106
for this purpose (though the actual semantics are to unbind the
@@ -110,15 +111,12 @@ \section{Code blocks, execution frames, and namespaces \label{execframes}}
110111
searched in the built-in namespace (which is actually the global
111112
namespace of the module \module{__builtin__}\refbimodindex{__builtin__}).
112113
The 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
114115
global 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
118119
execution\indexii{restricted}{execution} mode is in effect.
119-
\stindex{from}
120-
\stindex{exec}
121-
\stindex{global}
122120

123121
The namespace for a module is automatically created the first time a
124122
module is imported. The main module for a script is always called

0 commit comments

Comments
 (0)