Closed
Description
On the following code:
z = zip((1, 2, 3), ('a', 'b', 'c'))
reveal_type(z)
mypy 0.770 will output:
Revealed type is 'typing.Iterator[Tuple[builtins.int*, builtins.str*]]
while mypy 0.780 will output:
Revealed type is 'Tuple[builtins.tuple[builtins.object*], builtins.tuple[builtins.object*], builtins.tuple[builtins.object*]]'
The output from 0.770 is both more correct (since the zip
object is not a tuple) and more useful (since the types of the elements are known).
The fix for python/mypy#8454 adds additional overloaded definitions for zip(*...)
in typeshed, which in itself is useful. However, for some reason mypy seems to prefer the new 'star' definitions to the older and more correct 'non-star' definitions, which causes this regression.
Metadata
Metadata
Assignees
Labels
No labels