-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Mark code after for loops that never end as unreachable #19287
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Brian Schubert <[email protected]>
Looks good! However, I'm afraid that
This (untested, sorry for any typos) should print "Reached", and this PR should mark that line unreachable. It's a separate problem, of course, but I'm not sure this can be merged until we can somehow enforce |
I'm not sure it's possible to enforce any distinction there. We could enforce that |
I'll think about this tomorrow. The problem stems from the fact that |
Sorry yes that's what I meant re: I'm not convinced that subclassing a subclass will work correctly for |
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Fixes #18891