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
==
Optional
x: int | None if x == None: x # "Union[builtins.int, None]" else: x # "Union[builtins.int, None]"
x: int | None if x == None: x # x is None else: x # x is int
x: int | None if x == None: x # "Union[builtins.int, None]" else: x # "builtins.int"
This Mypy code comment seems to favour solution 2.
I am asking because if Mypy would follow solution 2 or 3, in-based narrowing of optional types could be implemented more consistently.
in
Related pull requests: #15760 #17154 #17044.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This Mypy code comment seems to favour solution 2.
I am asking because if Mypy would follow solution 2 or 3,
in
-based narrowing of optional types could be implemented more consistently.Related pull requests: #15760 #17154 #17044.
The text was updated successfully, but these errors were encountered: