Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive unused-variable for homonyms between comprehension variable and outer container #6136

Closed
jacobtylerwalls opened this issue Apr 2, 2022 · 1 comment · Fixed by #6154
Assignees
Labels
Blocker 🙅 Blocks the next release Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code
Milestone

Comments

@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Apr 2, 2022

Bug description

def f():
    project_id = []  # this ought to be called project_ids, but...
    assert (project_id > 0 for project_id in project_id)

Configuration

No response

Command used

pylint z.py

Pylint output

************* Module z
z.py:2:4: W0612: Unused variable 'project_id' (unused-variable)

-------------------------------------------------------------------
Your code has been rated at 6.67/10 (previous run: 10.00/10, -3.33)

Expected behavior

No msg

Pylint version

Regression in #6073. Found it by diffing primer package messages.

OS / Environment

No response

Additional dependencies

No response

@jacobtylerwalls jacobtylerwalls added Bug 🪲 Regression False Positive 🦟 A message is emitted but nothing is wrong with the code labels Apr 2, 2022
@jacobtylerwalls jacobtylerwalls added this to the 2.13.5 milestone Apr 2, 2022
@jacobtylerwalls
Copy link
Member Author

Not a regression if we fix it before 2.13.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker 🙅 Blocks the next release Bug 🪲 False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant