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
{{ message }}
Repository navigation
Missing TypeIs narrowing for variadic tuples #17599
I just checked the outcome of the tests with: #17232:
3,4,5 would also be fixed
6 does not change (at least the if-branch; else branch looks correct)
Output:
../xx.py:12: note: Revealed type is "tuple[builtins.int]"
../xx.py:18: note: Revealed type is "tuple[builtins.str, builtins.int]"
../xx.py:22: note: Revealed type is "tuple[builtins.str]"
../xx.py:24: note: Revealed type is "tuple[Union[builtins.int, builtins.str]]"
../xx.py:28: note: Revealed type is "tuple[builtins.str, builtins.str]"
../xx.py:30: note: Revealed type is "tuple[Union[builtins.int, builtins.str], Union[builtins.int, builtins.str]]"
../xx.py:34: note: Revealed type is "builtins.tuple[builtins.str, ...]"
../xx.py:36: note: Revealed type is "builtins.tuple[Union[builtins.int, builtins.str], ...]"
../xx.py:40: note: Revealed type is "tuple[builtins.str, Never, builtins.str]"
../xx.py:42: note: Revealed type is "tuple[builtins.str, Unpack[builtins.tuple[Union[builtins.int, builtins.str], ...]], builtins.str]"
Activity
kreathon commentedon Aug 16, 2024
I just checked the outcome of the tests with: #17232:
if-branch; else branch looks correct)Output:
hauntsaninja commentedon Jun 21, 2025
This is mostly fixed by #18193
There is still a variadic case that is unfixed
[-]Incorrect `TypeIs` narrowing for tuples[/-][+]Incorrect `TypeIs` narrowing for variadic tuples[/+][-]Incorrect `TypeIs` narrowing for variadic tuples[/-][+]Missing `TypeIs` narrowing for variadic tuples[/+]