When creating a union which has overlapping types, the inference fails. Either this should throw an error, or it should be inferred correctly.
from typing import TypeVar, Union, Iterable, List
T = TypeVar("T")
def foo(test: Union[T, List[T]]):
pass
foo([1]) # Fails with incompatible type List[<nothing>]