-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false positive when testing for-loops for unbalanced unpacking (W…
…0644) (#8892) * When checking for loops for unbalanced dict unpacking, compare the number 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. Co-authored-by: Pierre Sassoulas <[email protected]> Co-authored-by: Mark Byrne <[email protected]>
- Loading branch information
1 parent
de56b55
commit 7b72c39
Showing
4 changed files
with
100 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
When checking for unbalanced dict unpacking in for-loops, Pylint will now test whether the length of each value to be | ||
unpacked matches the number of unpacking targets. Previously, Pylint would test the number of values for the loop | ||
iteration, which would produce a false unbalanced-dict-unpacking warning. | ||
|
||
Closes #8156 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters