4 ms·
> but programmers using the language don't necessarily use these terms. this always annoyed me about the python type annotations, you are supposed to already k
by lyu07282 1y ago
> but programmers using the language don't necessarily use these terms.
this always annoyed me about the python type annotations, you are supposed to already know what contravariant / covariant / invariant means, like: `typing.TypeVar(name, covariant=False, contravariant=False, infer_variance=False)`
Its used in documentation and error messages too:
> the SendType of Generator behaves contravariantly, not covariantly or invariantly.
https://docs.python.org/3/library/typing.html#annotating-generators-and-coroutines https://docs.python.org/3/library/typing.html#annotating-gen...