We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Bug Report
I managed to make mypy think error in the following has implicit return, changing pretty much anything makes it work correctly:
error
__init__
x
sys.exit()
And I couldn't make similar code fail in any way when the function returns something. Swapping "C" with C doesn't fix anything either of course.
"C"
C
To Reproduce
Code with (most of) the changes mentioned above commented out:
import sys from typing import NoReturn # def error(c: "C") -> int: def error(c: "C") -> NoReturn: x = c.x # x = 2 + 2 sys.exit(1) # raise Exception() # return x class C: # x: int def __init__(self, x: int): self.x = x
Tried it after deleting caches and with --no-incremental and it still bugs out. (though i definitely didn't bisect all working cases like that)
--no-incremental
Expected Behavior
It sees that error doesn't return, as in all other variants.
Actual Behavior
bug.py:6: error: Implicit return in function which does not return Found 1 error in 1 file (checked 1 source file)
Your Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
I'm happy to report I can't trigger this on mypy 0.990.
I upgraded to python 3.11 and the hot off the press mypy 0.990, new mypy works on both 3.10 and 3.11, checked mypy 0.982 on 3.11 and that still fails.
Sorry, something went wrong.
Thanks, I think this was #13575
Thanks for the fix!
No branches or pull requests
Bug Report
I managed to make mypy think
error
in the following has implicit return, changing pretty much anything makes it work correctly:__init__
, even if there's other code therex
within class bodysys.exit()
before first use ofx
sys.exit()
And I couldn't make similar code fail in any way when the function returns something. Swapping
"C"
withC
doesn't fix anything either of course.To Reproduce
Code with (most of) the changes mentioned above commented out:
Tried it after deleting caches and with
--no-incremental
and it still bugs out. (though i definitely didn't bisect all working cases like that)Expected Behavior
It sees that
error
doesn't return, as in all other variants.Actual Behavior
Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: