-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Prevent warnings on dict / list index lookup with destructuring assignment #6808
Conversation
Pull Request Test Coverage Report for Build 2436051343
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the speedy fix! Some trivial feedback.
This comment has been minimized.
This comment has been minimized.
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉This comment was generated for commit 7931c3f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @timmartin , it looks great, I also like the new named function that makes it easier to understand the conditions.
…nment (#6808) Co-authored-by: Jacob Walls <[email protected]>
…nment (#6808) Co-authored-by: Jacob Walls <[email protected]>
Type of Changes
Description
The checkers
unnecessary-list-index-lookup
andunnecessary-dict-index-lookup
have a check that the usage of the index isn't appearing on the left hand side of an assignment. So for example:should not be a warning. However, this checker was not catching the case where the assignment was part of a destructuring expression, so there was a false positive for:
This has been fixed.
Closes #6788