[Python-bugs-list] [ python-Bugs-641111 ] Undocumented side effect of eval

noreply@sourceforge.net noreply@sourceforge.net
Wed, 20 Nov 2002 17:57:47 -0800


Bugs item #641111, was opened at 2002-11-20 03:54
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=641111&group_id=5470

Category: Python Library
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Dmitry Vasiliev (hdima)
Assigned to: Nobody/Anonymous (nobody)
Summary: Undocumented side effect of eval

Initial Comment:
Dictionary passed to eval as global name space is
filled up with global variables:

>>> m = {}
>>> m == {}
1
>>> eval("1", m)
1
>>> m == {}
0


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-11-20 20:57

Message:
Logged In: YES 
user_id=31435

Well, yes.  That's what "global name space" means.  Why 
would you assume it's limited to read-only?  Where would 
you *expect* global bindings to be made, if not in the global 
namespace?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=641111&group_id=5470