-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
Description
PEP 483 explains variance and provides this example:
T_co = TypeVar('T_co', Employee, Manager, covariant=True)
T_contra = TypeVar('T_contra', Employee, Manager, contravariant=True)
class Base(Generic[T_contra]):
...
class Derived(Base[T_co]):
...
Mypy gives this error when I try this example out:
error: Variance of TypeVar "T_co" incompatible with variance in parent type [type-var]
Metadata
Metadata
Assignees
Labels
Projects
Status
Todo