The correct behavior is that of Cpython in this case:

Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> glob = {}
>>> loc = {}
>>> exec "a=12" in glob, loc
>>> loc
{'a': 12}

Seems that we have introduced bug in 0.9.6 

Thanks!
Martin


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tibor Berkovits
Sent: Wednesday, December 14, 2005 10:39 AM
To: users@lists.ironpython.com
Cc: Tibor Berkovits
Subject: [IronPython] Exec Question

The following python code snippet

glob = {}
loc = {}
exec "a=12" in glob, loc

behaves differently under IP 0.9.5 vs. IP 0.9.6 with respect to which 
dictionary the definition of 'a' is inserted into. In IP095 it goes to loc, 
while in IP096 it goes to glob. 

Can someone please explain which one is the "correct" behavior ? 

Regards,
TB
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to