Closed
Description
from typing import Union, NoReturn
def func() -> Union[str, NoReturn]:
return 'test'
func().lower()
Here, Unoin[str, NoReturn]
should effectively be treated as the same as str
. But mypy doesn't seem to do that.
$ mypy code.py
code.py:6: error: Item "NoReturn" of "Union[str, NoReturn]" has no attribute "lower"
Found 1 error in 1 file (checked 1 source file)
More information in this discussion page: python/typing#994 (comment)