Closed
Description
See python/typeshed#721 (comment). The issue is that after
T = Union[Tuple[int, int], Tuple[int, int, str]]
def f() -> T: pass
a = f()
reveal_type(a[0])
reveal_type(a[2])
the item types are considered to be Any. A better approach would be to understand that a[0] is always an int while a[2] is invalid without some check (however we can't do isinstance() checks on tuple lengths so that's problematic).