false failure on list comprehension redefines

Bug #1418997 reported by bei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pyflakes
Fix Released
Undecided
Unassigned

Bug Description

I believe the following is a false failure reported by pyflakes.

Code snippet:

some_list = [(1, 2), (3, 4)]
first_tuple, _ = some_list
some_list_with_results = [a for a, _ in some_list]

Triggers the following violation:

list comprehension redefines '_' from line 2

For completeness i'm using:

pyflakes --version
0.8.1

/bei

Revision history for this message
Steven Myint (myint) wrote :

I think this is avoided when running pyflakes with Python 3 now. Though, I guess it still would affect Python 2.

https://github.com/pyflakes/pyflakes/pull/14

Revision history for this message
Phil Frost (bitglue) wrote :

I concur. That PR should be in the next release.

Changed in pyflakes:
status: New → Fix Committed
Phil Frost (bitglue)
Changed in pyflakes:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.