![](https://secure.gravatar.com/avatar/af4d71cd09e5d9b4776a8f3cee4d15fc.jpg?s=120&d=mm&r=g)
2 Sep
2020
2 Sep
'20
8:12 p.m.
E.g, why would this: def foo(x: Union[str, int]) -> int: x = 5 return x Behave differently than: def foo(x: Union[str, int]) -> int: if isinstance(x, int): return x return 5 If both are considered narrowing?