basedmypy
basedmypy copied to clipboard
Support distributed unions on generics
Is this valid? Sounds valid to me
def f(i: list[T]) -> list[T]: ...
a: list[str] | list[int]
# current
reveal_type(f(a)) # Cannot infer type argument 1 of "f" # list[Any (from error)]
# expected
reveal_type(f(a)) # list[str] | list[int]
This sounds cool, but I think #360 covers the same usecase