basedmypy
basedmypy copied to clipboard
Confusing error using intersection operator (`&`) in value position (eg `TypeVar` bounds)
from typing import TypeVar
class Foo: ...
class Bar: ...
T = TypeVar("T", bound=Foo & Bar)
# error: TypeVar "bound" must be a type
# error: Unsupported left operand type for & ("type[Foo]")
Something more like "Use quoted types or basedtyping.Intersection".