summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-08-03 05:17:58 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-08-03 05:17:58 (GMT)
commit70fcdb8be0ef544432b8bd48a0abd0475f0fb778 (patch)
tree6f26ba6f61543a000f0843510afaf2418bcf0886 /Doc/lib
parenta57ec93b934b1c04ab837aa541fc7101c6bc0055 (diff)
downloadcpython-70fcdb8be0ef544432b8bd48a0abd0475f0fb778.zip
cpython-70fcdb8be0ef544432b8bd48a0abd0475f0fb778.tar.gz
cpython-70fcdb8be0ef544432b8bd48a0abd0475f0fb778.tar.bz2
Document general mappings for the locals argument for exec and execfile().
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libfuncs.tex15
1 files changed, 8 insertions, 7 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index b3d3d30..ec6a66c 100644
--- a/Doc/lib/libfuncs.tex
+++ b/Doc/lib/libfuncs.tex
@@ -343,13 +343,14 @@ class C:
and does not create a new module.\footnote{It is used relatively
rarely so does not warrant being made into a statement.}
- The arguments are a file name and two optional dictionaries. The
- file is parsed and evaluated as a sequence of Python statements
- (similarly to a module) using the \var{globals} and \var{locals}
- dictionaries as global and local namespace. If the \var{locals}
- dictionary is omitted it defaults to the \var{globals} dictionary.
- If both dictionaries are omitted, the expression is executed in the
- environment where \function{execfile()} is called. The return value is
+ The arguments are a file name and two optional dictionaries. The file is
+ parsed and evaluated as a sequence of Python statements (similarly to a
+ module) using the \var{globals} and \var{locals} dictionaries as global and
+ local namespace. If provided, \var{locals} can be any mapping object.
+ \versionchanged[formerly \var{locals} was required to be a dictionary]{2.4}
+ If the \var{locals} dictionary is omitted it defaults to the \var{globals}
+ dictionary. If both dictionaries are omitted, the expression is executed in
+ the environment where \function{execfile()} is called. The return value is
\code{None}.
\warning{The default \var{locals} act as described for function