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
It would be nice if mypy's type inference was extended so that it knew that x was a Tuple[Any, Any, Any] rather than the less specific Tuple[Any, ...]. And similarly for cases like if len(x) == 2: ...; in the body of the if mypy can be sure that x is a Tuple[Any, Any].
(Confusingly, the actual value printed by reveal_type in the example is builtins.tuple[Any], but as far as I can tell this is a synonym of Tuple[Any, ...])
The text was updated successfully, but these errors were encountered:
Consider this code:
It would be nice if mypy's type inference was extended so that it knew that
x
was aTuple[Any, Any, Any]
rather than the less specificTuple[Any, ...]
. And similarly for cases likeif len(x) == 2: ...
; in the body of theif
mypy can be sure thatx
is aTuple[Any, Any]
.(Confusingly, the actual value printed by
reveal_type
in the example isbuiltins.tuple[Any]
, but as far as I can tell this is a synonym ofTuple[Any, ...]
)The text was updated successfully, but these errors were encountered: