Closed
Description
According to tracking issue python/mypy#5818, assert_never
was introduced in typing_extensions
version 4.1.0. At runtime, this clearly seems to work, which I can verify via:
python -c "from typing_extensions import assert_never"
However if I type check the code with mypy it complains at the line of the import:
error: Module "typing_extensions" has no attribute "assert_never"
I'm not sure if this an issue with typing_extensions
or mypy though.
In any case, assert_never
is supposed to have runtime behavior (to raise an assertion), i.e., it is not something that is supposed to be hidden behind a TYPE_ASSERTION
barrier.