-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix #5683: False positive used-before-assignment
in loop else
where the only non-break exit is through except
#5684
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
Fix #5683: False positive used-before-assignment
in loop else
where the only non-break exit is through except
#5684
Conversation
4a6fdf8
to
89d54f0
Compare
Pull Request Test Coverage Report for Build 1756653853
π - Coveralls |
9056be0
to
78b3482
Compare
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 @jacobtylerwalls! That's quite a lot of code!
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.
LGTM, the typing issue is minor even if we might want to dig into it before merging (fix it then rebase on it to remove the typing that became uneeded?). Thank you @jacobtylerwalls , great addition to 2.13 !
): | ||
break | ||
else: | ||
# No continue found, so we arrived at our special case! |
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.
That was a whole journey π !
print('The time is:') | ||
break | ||
else: | ||
raise error |
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'm pretty sure we're going to still be surprised by the code that exists in the wild, but I'm also pretty confident we won't be surprised often. Those tests are thorough !
5a105a1
to
453c00a
Compare
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.
Sorry! Should have changed my review to approved after the last comments were integrated!
@jacobtylerwalls Just something I thought of, I see the confidence of |
What about a new level |
I like that a lot! |
Cool, I'll PR it unless you've already started ππ»ββοΈ |
No I haven't, would certainly welcome a PR π |
@jacobtylerwalls This seems to have landed in stale PR heaven π If you could update the test output I will merge this asap! |
β¦p `else` where the only non-break exit is via `except`
c02c8ae
to
ec6f373
Compare
Thanks! |
Type of Changes
Description
Closes #5683