[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 <http://bugs.python.org/issu

[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 <http://bugs.python.org/issue30577> ___ ___ Python-bug

[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 co