New submission from David M. Beazley <[EMAIL PROTECTED]>:

Is the following code valid Python 3 or not?

def foo():
    x = 1
    exec("x = 42")
    print(x)    # Prints 1  (exec has no effect)

I know there are a variety of issues surrounding exec(), function 
bodies, and other matters.   Just wondering if this sort of thing is now 
forbidden or not.

----------
components: Interpreter Core
messages: 76508
nosy: beazley
severity: normal
status: open
title: exec inside a function
type: behavior
versions: Python 3.0

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4447>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to