You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using match self or match self.value inside a method or property on an Enum, mypy reports an error on assert_never(). This works as expected in pyright.
main.py:17: error: Argument 1 to "assert_never" has incompatible type "MyEnum"; expected "NoReturn" [arg-type]
main.py:27: error: Argument 1 to "assert_never" has incompatible type "Union[str, str]"; expected "NoReturn" [arg-type]
Found 2 errors in 1 file (checked 1 source file)
Your Environment
Mypy version used: mypy 1.2.0 (compiled: yes)
Mypy command-line flags: --show-error-codes
Mypy configuration options from mypy.ini (and other config files): n/a