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

Jonathan Hartley report at bugs.python.org
Fri Apr 8 22:53:05 CEST 2011


Jonathan Hartley <tartley at tartley.com> 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 "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in C
  File "<stdin>", line 3, in <listcomp>

----------
nosy: +jonathan.hartley
versions: +Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11796>
_______________________________________


More information about the Python-bugs-list mailing list