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
from typing import assert_never def foo(arg: tuple[int, int] | int) -> None: match arg: case (int() as a, int() as b): print(f"{a}{b}") case int() as c: print(f"{c}") case _: assert_never(arg)
mypy . --strict reports error: Argument 1 to "assert_never" has incompatible type "tuple[int, int]"; expected "NoReturn" [arg-type]
mypy . --strict
error: Argument 1 to "assert_never" has incompatible type "tuple[int, int]"; expected "NoReturn" [arg-type]
This feels odd? pyright behaves as I'd expect, as the pattern match is exhaustive
pyright
Python 3.12.2 mypy 1.10.1 (compiled: yes)
The text was updated successfully, but these errors were encountered:
Duplicate of #16835
Sorry, something went wrong.
No branches or pull requests
mypy . --strict
reportserror: Argument 1 to "assert_never" has incompatible type "tuple[int, int]"; expected "NoReturn" [arg-type]
This feels odd?
pyright
behaves as I'd expect, as the pattern match is exhaustiveThe text was updated successfully, but these errors were encountered: