Activity log for bug #1373143

Date Who What changed Old value New value Message
2014-09-23 21:49:13 Brian Warner bug added bug
2014-09-23 21:49:13 Brian Warner attachment added test program https://bugs.launchpad.net/bugs/1373143/+attachment/4212875/+files/t.py
2014-09-23 21:50:00 Brian Warner description With pyflakes-0.8.1 and python-2.7.8, the following test program gets the expected complaint: import foo foo() def bar(): a = 0 #a = [1 for foo in []] for foo in []: pass del a pyflakes t.py t.py:6: import 'foo' from line 1 shadowed by loop variable But if you uncomment the list comprehension, the pyflakes complaints go away. I think the presence of the list comprehension should actually *increase* the number of complaints: "foo" is being shadowed in both the list comprehension and the for-loop. With pyflakes-0.8.1 and python-2.7.8, the following test program gets the expected complaint: import foo foo() def bar():     a = 0     #a = [1 for foo in []]     for foo in []:         pass     del a pyflakes t.py t.py:6: import 'foo' from line 1 shadowed by loop variable But if you uncomment the list comprehension, the pyflakes complaints go away. I think the presence of the list comprehension should actually *increase* the number of complaints: "foo" is being shadowed in both the list comprehension and the for-loop.
2014-09-23 22:13:02 Ian Cordasco pyflakes: status New Confirmed