How exactly does Python evaluate class attributes? I\'ve stumbled across an interesting quirk (in Python 2.5.2) that I\'d like explained.
I have a class with some a
From PEP 289:
After exploring many possibilities, a consensus emerged that binding issues were hard to understand and that users should be strongly encouraged to use generator expressions inside functions that consume their arguments immediately. For more complex applications, full generator definitions are always superior in terms of being obvious about scope, lifetime, and binding [6].
[6] (1, 2) Patch discussion and alternative patches on Source Forge http://www.python.org/sf/872326
It's how generator expressions are scoped as far as I can make out.