mypy
mypy copied to clipboard
(🎁) narrow falsey string to `Literal[""]`
from typing import Literal
def f() -> Literal[""]:
a = ""
return a and exit() # error: Incompatible return value type (got "str", expected "Literal['']") [return-value]