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.
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 @@
\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