We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See code.
To Reproduce
from typing import Optional class Global: attr: Optional[int] = None G = Global() def f() -> None: G.attr = 1 def t() -> None: G.attr = None f() assert G.attr is not None reveal_type(G)
Expected Behavior
Mypy shows the type of G at the last line (and G.attr is of type int).
G
G.attr
int
Actual Behavior
Mypy completely skips the lines below assert.
assert
Success: no issues found in 1 source file
Your Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
#11649 #11969
This issue a well known limitation.
Sorry, something went wrong.
No branches or pull requests
Bug Report
See code.
To Reproduce
Expected Behavior
Mypy shows the type of
G
at the last line (andG.attr
is of typeint
).Actual Behavior
Mypy completely skips the lines below
assert
.Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: