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

refactor(b038): Cleanup unused code in B038Checker #448

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

mimre25
Copy link
Contributor

@mimre25 mimre25 commented Jan 15, 2024

The unused code would introduce a bug when used, thus I believe it's better to remove it.

Essentially, it would've flagged any del statement within a loop, without check for the name.
However, because the B038Checker visits Del nodes, and doesn't call generic_visit from there, we'll never reach a Name node that has the ctx == Del.

I've added a test case, just to make sure 🙂

The unused code would introduce a bug when used, thus I believe it's
better to remove it.
Copy link
Collaborator

@cooperlees cooperlees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Thanks for finding before it went wide and we got flooded with false positives!

@cooperlees cooperlees merged commit 9c100b6 into PyCQA:main Jan 15, 2024
6 checks passed
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.

2 participants