Message72007
| 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: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 |
|