[issue30577] Multidimensional comprehensions cannot access class variables except in the first for

2017-06-05 Thread Zachary Ware
Changes by Zachary Ware : -- stage: -> resolved status: open -> closed superseder: -> Comprehensions in a class definition mostly cannot access class variable ___ Python tracker _

[issue30577] Multidimensional comprehensions cannot access class variables except in the first for

2017-06-05 Thread Fengyang Wang
Fengyang Wang added the comment: It looks like this is a duplicate of http://bugs.python.org/issue11796 Sorry for the noise. -- resolution: -> duplicate ___ Python tracker ___

[issue30577] Multidimensional comprehensions cannot access class variables except in the first for

2017-06-05 Thread Fengyang Wang
Fengyang Wang added the comment: By the way, in Python 2.7 at least, this was working. -- ___ Python tracker ___ ___ Python-bugs-list

[issue30577] Multidimensional comprehensions cannot access class variables except in the first for

2017-06-05 Thread Fengyang Wang
New submission from Fengyang Wang: Reduced reproduction: class X: r = [1, 2, 3] z = [(i, j) for i in [4, 5] for j in r] fails with "NameError: name 'r' is not defined". The expected behavior would be for r to be resolved as the r in the class namespace. Note in contrast that class Y: