You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Covariant type variable should not be used in the return type in an invariant position, for example like this:
CV = TypeVar('CV', covariant=True)
class A(Generic[CV]):
def foo(self) -> List[CV]: ... # Error, should be
# Sequence[CV] or similar, since List is invariant
There is probably a similar rule for contravariance.
The text was updated successfully, but these errors were encountered:
Covariant type variable should not be used in the return type in an invariant position, for example like this:
There is probably a similar rule for contravariance.
The text was updated successfully, but these errors were encountered: