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 "consider-using-dict-items" when iteration over dict.keys() #9554
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Milestone
Comments
Flamefire
added
the
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
label
Apr 18, 2024
jacobtylerwalls
added
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
and removed
Needs triage 📥
Just created, needs acknowledgment, triage, and proper labelling
labels
Apr 19, 2024
mbyrnepr2
added a commit
to mbyrnepr2/pylint
that referenced
this issue
May 3, 2024
… ``os.environ`` using the ``os.environ.keys()`` operation and then deleting an item using the key as a lookup. Closes pylint-dev#9554
Pierre-Sassoulas
pushed a commit
that referenced
this issue
May 4, 2024
When iterating ``os.environ`` using the ``os.environ.keys()`` operation and then deleting an item using the key as a lookup. Closes #9554 Co-authored-by: Pierre Sassoulas <[email protected]>>
github-actions bot
pushed a commit
that referenced
this issue
May 4, 2024
When iterating ``os.environ`` using the ``os.environ.keys()`` operation and then deleting an item using the key as a lookup. Closes #9554 Co-authored-by: Pierre Sassoulas <[email protected]>> (cherry picked from commit c864cd4)
Pierre-Sassoulas
pushed a commit
that referenced
this issue
May 4, 2024
When iterating ``os.environ`` using the ``os.environ.keys()`` operation and then deleting an item using the key as a lookup. Closes #9554 Co-authored-by: Pierre Sassoulas <[email protected]>> (cherry picked from commit c864cd4) Co-authored-by: Mark Byrne <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
False Positive 🦟
A message is emitted but nothing is wrong with the code
Needs PR
This issue is accepted, sufficiently specified and now needs an implementation
Bug description
The loop triggers both "consider-using-dict-items" & "consider-iterating-dictionary". The former is a false positive.
This is especially annoying when "consider-iterating-dictionary" is disabled because someone insists that
.keys()
is clearerHowever fixing the 2nd warning by removing
.keys()
both go awayCommand used
Pylint output
Expected behavior
No "consider-using-dict-items" warning
Pylint version
The text was updated successfully, but these errors were encountered: