mypy
mypy copied to clipboard
no error when `TypeVar` with explicit variance is used in the wrong position when it's part of a union
from typing import Generic, TypeVar
T = TypeVar("T", covariant=True)
class Foo(Generic[T]):
def b(self, value: T | int) -> None: ... # no error