from typing import reveal_type
def f[T](x: T) -> T:
return x
x = (1, "hello world")
reveal_type(f(x)) # this is `tuple[int, str]`
reveal_type(f((1, "hello world"))) # but this is `tuple[Literal[1, "hello world"], ...]`?
In the second case, we've downgraded the tuple to a variable-length one and no longer know the types at specific indices.