I think that Mapping[KT, VT] should be covariant in both KT and VT. The argument for this is that it doesn't have any mutation operations. Mypy might complain (or may eventually start to complain) about having covariant type variables in argument types but in this case it's okay so we can probably just # type: ignore them.
(It wouldn't be safe since somebody can write a get method that actually mutates the mapping, but consenting adults...)
I think that
Mapping[KT, VT]should be covariant in bothKTandVT. The argument for this is that it doesn't have any mutation operations. Mypy might complain (or may eventually start to complain) about having covariant type variables in argument types but in this case it's okay so we can probably just# type: ignorethem.(It wouldn't be safe since somebody can write a
getmethod that actually mutates the mapping, but consenting adults...)