Message72007
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 |
|
Date |
User |
Action |
Args |
2008-08-27 04:54:24 | ajaksu2 | set | recipients:
+ ajaksu2, kaizhu |
2008-08-27 04:54:24 | ajaksu2 | set | messageid: <1219812864.57.0.863571440452.issue3692@psf.upfronthosting.co.za> |
2008-08-27 04:54:23 | ajaksu2 | link | issue3692 messages |
2008-08-27 04:54:22 | ajaksu2 | create | |
|