[issue11796] list and generator expressions in a class definition fail if expression condition refers to a class variable

2011-04-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Devs are aware that there is an exception to the general rule for the 'for' clause. There is a technical reason why the exception is possible, though I have forgotten it. Since you already know that changing the general behavior has been rejected, are you as

[issue11796] list and generator expressions in a class definition fail if expression condition refers to a class variable

2011-04-08 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue11796] list and generator expressions in a class definition fail if expression condition refers to a class variable

2011-04-08 Thread Andreas Stührk
Changes by Andreas Stührk : -- nosy: +Trundle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue11796] list and generator expressions in a class definition fail if expression condition refers to a class variable

2011-04-08 Thread Jonathan Hartley
Jonathan Hartley added the comment: Is also exhibited by other class variable being used in the 'output' clause of the list comprehension: >>> class C: ... x = 3 ... z = [z*x for z in range(4)] Traceback (most recent call last): File "", line 1, in File "", line 3, in C File "",

[issue11796] list and generator expressions in a class definition fail if expression condition refers to a class variable

2011-04-08 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue11796] list and generator expressions in a class definition fail if expression condition refers to a class variable

2011-04-08 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue11796] list and generator expressions in a class definition fail if expression condition refers to a class variable

2011-04-07 Thread Menno Smits
New submission from Menno Smits : A list comprehension or generator expression in a class definition fails with NameError if it has a condition that refers to another class variable. This doesn't occur if the class variable is used the "in" part of the expression. The following works: class F