summaryrefslogtreecommitdiffstats
path: root/Doc/lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-07-02 06:41:07 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-07-02 06:41:07 (GMT)
commit214b1c3aaea3e83302df9ea37a37b3c7548b92b1 (patch)
tree4ddeda01308aec48c7edda3188a4aad84dc9435b /Doc/lib
parent78bace7442bb89aa005950a1e37f71d4704d4cb6 (diff)
downloadcpython-214b1c3aaea3e83302df9ea37a37b3c7548b92b1.zip
cpython-214b1c3aaea3e83302df9ea37a37b3c7548b92b1.tar.gz
cpython-214b1c3aaea3e83302df9ea37a37b3c7548b92b1.tar.bz2
SF Bug #215126: Over restricted type checking on eval() function
The builtin eval() function now accepts any mapping for the locals argument. Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing down the normal case. My timings so no measurable impact.
Diffstat (limited to 'Doc/lib')
-rw-r--r--Doc/lib/libfuncs.tex8
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex
index fa9cd55..0c5b0e3 100644
--- a/Doc/lib/libfuncs.tex
+++ b/Doc/lib/libfuncs.tex
@@ -291,8 +291,12 @@ class C:
\end{funcdesc}
\begin{funcdesc}{eval}{expression\optional{, globals\optional{, locals}}}
- The arguments are a string and two optional dictionaries. The
- \var{expression} argument is parsed and evaluated as a Python
+ The arguments are a string and optional globals and locals. If provided,
+ \var{globals} must be a dictionary. If provided, \var{locals} can be
+ any mapping object. \versionchanged[formerly \var{locals} was required
+ to be a dictionary]{2.4}
+
+ The \var{expression} argument is parsed and evaluated as a Python
expression (technically speaking, a condition list) using the
\var{globals} and \var{locals} dictionaries as global and local name
space. If the \var{globals} dictionary is present and lacks