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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 21 Nov 2002 08:51:08 -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: Documentation
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Dmitry Vasiliev (hdima)
>Assigned to: Fred L. Drake, Jr. (fdrake)
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-21 11:51

Message:
Logged In: YES 
user_id=31435

Changed category to Doc and assigned to Fred, since there's 
no chance the implementation will change.  I don't find the 
docs unclear, but this is deep stuff and it's certainly 
understanble that others may not.

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

Comment By: Dmitry Vasiliev (hdima)
Date: 2002-11-21 03:55

Message:
Logged In: YES 
user_id=388573

I gues that a function don't have a side effect if the
effect not documented. Why is dictionary passed as local
name space  not filled up with local variables? I think docs
should say anything about this.

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

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