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

Fix false positive when testing for-loops for unbalanced unpacking (W0644) #8891

Conversation

Neowizard
Copy link
Contributor

Type of Changes

Type
🐛 Bug fix

Description

When checking for-loops for unbalanced dict unpacking, Pylint would compare the length of the targets with the length of the values iterable. However, since the for-loop would iterate the values and unpack each value in turn, Pylint should compare the length of the targets with the length of each value (and not the total length of values).

Closes #8156

…mber of targets to the size of each value, instead of the number of values, since the for loop will iterate the values and unpack each in turn onto the targets.
@Neowizard Neowizard closed this Jul 27, 2023
@Neowizard Neowizard deleted the false-positive-unbalanced-dict-unpacking-in-for branch July 27, 2023 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False reports on W0644 unbalanced-dict-unpacking in pylint 2.16.0
2 participants