[issue4831] exec() behavior - revisited

2013-05-07 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue4831] exec() behavior - revisited

2009-03-31 Thread Jeremy Hylton
Jeremy Hylton added the comment: I think this bug ran out of steam. Python is behaving as intended, and I think Georg addressed all of David's questions. -- nosy: +jhylton resolution: -> works for me status: open -> closed ___ Python tracker

[issue4831] exec() behavior - revisited

2009-01-04 Thread Georg Brandl
Georg Brandl added the comment: Yes, the dictionary will always contain "a" afterwards. However, a cleaner way would be to use locals().copy(), or, if you don't need current locals in the exec'd string, just a fresh dict. In scopes not using the optimized locals, there may be some other effect

[issue4831] exec() behavior - revisited

2009-01-04 Thread David M. Beazley
David M. Beazley added the comment: One further followup just to make sure I'm clear. Is it always safe to pass the result of locals() into exec and extract the result as shown in my example? Since I'm writing about this in a book, I just want to make absolutely certain I know what's going

[issue4831] exec() behavior - revisited

2009-01-04 Thread Georg Brandl
Georg Brandl added the comment: > Please forgive me, but I'm really trying to wrap my brain around the > behavior of exec() in Python 3. Here's a quote from the documentation: >"In all cases, if the optional parts are omitted, the code is > executed in the current scope." > This is

[issue4831] exec() behavior - revisited

2009-01-04 Thread David M. Beazley
New submission from David M. Beazley : Please forgive me, but I'm really trying to wrap my brain around the behavior of exec() in Python 3. Here's a quote from the documentation: "In all cases, if the optional parts are omitted, the code is executed in the current scope." This is refe