This came up in #136 (comment).
There seems to be a bug in the definition of ItemsView in typing.py: it has three type parameters, but its unclear what they mean. When looking at the corresponding definition in typeshed, it actually makes more sense:
class MappingView(Sized):
def __len__(self) -> int: ...
class ItemsView(AbstractSet[Tuple[_KT_co, _VT_co]], MappingView, Generic[_KT_co, _VT_co]):
def __contains__(self, o: object) -> bool: ...
def __iter__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ...
Here MappingView is not generic (since Sized isn't), and ItemsView has only two parameters, clearly meant for keys and values, and clarified by the __contains__ and __iter__ signatures.
I think we should follow this example.
This came up in #136 (comment).
There seems to be a bug in the definition of ItemsView in typing.py: it has three type parameters, but its unclear what they mean. When looking at the corresponding definition in typeshed, it actually makes more sense:
Here MappingView is not generic (since Sized isn't), and ItemsView has only two parameters, clearly meant for keys and values, and clarified by the
__contains__and__iter__signatures.I think we should follow this example.