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
mixedtuple.py:14: note: Revealed type is 'Tuple[builtins.int, builtins.str]'
mixedtuple.py:15: note: Revealed type is 'def () -> typing.Iterator[builtins.object*]'
mixedtuple.py:17: error: Argument 1 to "g" has incompatible type "Tuple[int, str]"; expected "MixedIter" [arg-type]
What is the behavior/output you expect?
I'd expect both f(mixedTuple) and g(mixedTuple) to be accepted without errors.
What are the versions of mypy and Python you are using?
mypy 0.730 on Python 3.7.2.
The text was updated successfully, but these errors were encountered:
msullivan
changed the title
Use Union return type for Tuple.__iter__ for mixed-type tuples
Use Union for tuple fallback?
Oct 4, 2019
It seems possible that we could switch to using a union for tuple fallbacks instead of a join and drop those special cases subtyping special cases. The normal worry about switching from using a join to using a union--that it will break calls functions with invariant type constructors--seems less pronounced here since tuples are immutable.
I'd expect both
f(mixedTuple)
andg(mixedTuple)
to be accepted without errors.mypy 0.730 on Python 3.7.2.
The text was updated successfully, but these errors were encountered: