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
x: int | None y: int match x: case None: pass case y: pass
main.py:6: error: Incompatible types in capture pattern (pattern captures type "int | None", variable has type "int") [misc]
https://mypy-play.net/?mypy=latest&python=3.10&gist=b3423e1eab3afadc8e4d172761d256a2
This should be fine, because the previous case ensured that y is not None.
y
I ran into this in a real use case.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
https://mypy-play.net/?mypy=latest&python=3.10&gist=b3423e1eab3afadc8e4d172761d256a2
This should be fine, because the previous case ensured that
y
is not None.I ran into this in a real use case.
The text was updated successfully, but these errors were encountered: