
2 Sep
2020
2 Sep
'20
1: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?