[IronPython] Exec Question

Martin Maly Martin.Maly at microsoft.com
Wed Dec 14 20:31:33 CET 2005

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 


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tibor Berkovits
Sent: Wednesday, December 14, 2005 10:39 AM
To: users at 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 ? 

users mailing list
users at lists.ironpython.com

More information about the Ironpython-users mailing list