This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ajaksu2
Recipients ajaksu2, kaizhu
Date 2008-08-27.04:54:22
SpamBayes Score 1.0495176e-08
Marked as misclassified No
Message-id <1219812864.57.0.863571440452.issue3692@psf.upfronthosting.co.za>
In-reply-to
Content
I believe the problem is that list comprehensions in 3.0 have scope like
that of genexprs in 2.5, but the change was deliberate (as it also
avoids leaking of temp variables).

Compare to 2.5:
>>> class Foo(object):
...    class_attribute1 = 1
...    class_attribute2 = (class_attribute1 for x in range(8))
...
>>> Foo.class_attribute2.next()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in <genexpr>
NameError: global name 'class_attribute1' is not defined
History
Date User Action Args
2008-08-27 04:54:24ajaksu2setrecipients: + ajaksu2, kaizhu
2008-08-27 04:54:24ajaksu2setmessageid: <1219812864.57.0.863571440452.issue3692@psf.upfronthosting.co.za>
2008-08-27 04:54:23ajaksu2linkissue3692 messages
2008-08-27 04:54:22ajaksu2create