[issue3692] improper scope in list comprehension, when used in class declaration

Georg Brandl report at bugs.python.org
Wed Aug 27 09:32:03 CEST 2008


Georg Brandl <georg at python.org> added the comment:

This won't change -- in 3.0, list comprehensions and generator
expressions are both implemented using a function, so it's like the
following:

class Foo:
    attribute1 = 1
    def f():
        return attribute1
    attribute2 = f()

----------
nosy: +georg.brandl
resolution:  -> wont fix
status: open -> closed

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


More information about the Python-bugs-list mailing list