[issue9226] erroneous behavior when creating classes inside a closure

Mark Dickinson report at bugs.python.org
Sun Jul 11 22:37:48 CEST 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

Jython 2.5.1 gives the same results as Python:

newton:~ dickinsm$ cat test.py
x = "error"

def test(x):
    class Test(object):
        x = x
    print("x: ", x)
    print("Test.x: ", Test.x)

test("success")
newton:~ dickinsm$ jython2.5.1/jython test.py
('x: ', 'success')
('Test.x: ', 'error')

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9226>
_______________________________________


More information about the Python-bugs-list mailing list