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
Implemented new check unnecessary-dict-index-lookup
#4485
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Some initial comments. This looks pretty good already.
I was thinking about if we maybe should change the name a bit. Something like unnecessary-dict-index-lookup
. What do you think?
sure! I'll make the change |
unnecessary-dict-indexing
unnecessary-dict-index-lookup
Documentation update Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
sorry about that, was trying to work on some other checker but forgot to switch branches |
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.
I like the refactoring you did! Some more comments
tests/functional/u/unnecessary/unnecessary_dict_index_lookup.py
Outdated
Show resolved
Hide resolved
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.
Another one done 🚀
You're on fire @yushao2 :) afaik 75% of the new checkers in 2.9, not bad ! |
Steps
doc/whatsnew/<current release.rst>
.Description
Implemented a new checker,
unnecessary-dict-indexing
, which detects for instances where index-lookup is used withdict.items()
.Type of Changes
Related Issue
Closes #4470