-
Notifications
You must be signed in to change notification settings - Fork 958
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: B031 #3829
Comments
👍 I think this is the same as #3801. |
Ahh, sorry--should have had a quick look before submitting this! Thanks, |
All good, it's useful to know that others have hit this too and to see another example! |
I'll try to look into it over the weekend but I guess it would be better to track it in one issue. We could move the example in the other one. |
@dhruvmanila - Sounds good, I'm going to mark as a duplicate. |
Ruff 0.0.260
Reproducer:
bug_b031.py
Sorry for the rather contrived example, this was reduced from some code in Sphinx. Broadly I think that the error comes from the heuristic checking any re-use, whereas here as the symbol
g
is used twice, but only once per branch of an if/elif/else chain.Please would it be possible to add some heuristic for tracking usages like this, in if/elif/else chains?
Thanks,
Adam
The text was updated successfully, but these errors were encountered: