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
Narrow falsey str/bytes/int to literal type (#17818)
Closes#16891
### Before
```python
from typing import Literal
def f1(a: str) -> Literal[""]:
return a and exit() # E: Incompatible return value type (got "str", expected "Literal['']")
def f2(a: int) -> Literal[0]:
return a and exit() # E: Incompatible return value type (got "int", expected "Literal[0]")
def f3(a: bytes) -> Literal[b""]:
return a and exit() # E: Incompatible return value type (got "bytes", expected "Literal[b'']")
```
### After
```none
Success: no issues found in 1 source file
```
0 commit comments