You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Multidimensional comprehensions cannot access class variables except in the first for #74762
bpo-11796: Comprehensions in a class definition mostly cannot access class variable
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2017-06-06.00:13:57.148>created_at=<Date2017-06-05.23:56:16.901>labels= ['interpreter-core', 'type-bug']
title='Multidimensional comprehensions cannot access class variables except in the first for'updated_at=<Date2017-06-06.00:13:57.147>user='https://bugs.python.org/fengyangwang'
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
Activity
fengyangwang commentedon Jun 5, 2017
Reduced reproduction:
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
does not fail.
(Version 3.5.2 on Windows)
fengyangwang commentedon Jun 5, 2017
By the way, in Python 2.7 at least, this was working.
fengyangwang commentedon Jun 6, 2017
It looks like this is a duplicate of http://bugs.python.org/issue11796
Sorry for the noise.