In the following example, the last revealed type could/should be Union[builtins.int, None]:
def f() -> bool: return True u: int | tuple[int] x = None if f(): x = u if isinstance(x, tuple): x = x[0] reveal_type(x) # note: "builtins.int" reveal_type(x) # note: Revealed type is "Union[builtins.int, Tuple[builtins.int], None]"
See this comment for background information.
Activity