__reversed__ on dict views (#13073)

KeysView doesn't have __reversed__, but dict_keys does. When this
was added to typeshed, we didn't have dict_keys as a separate type.
This commit is contained in:
Stephen Morton
2024-11-23 05:09:37 -08:00
committed by GitHub
parent ba9116c684
commit 982fb8358b
5 changed files with 3 additions and 12 deletions

View File

@@ -660,7 +660,6 @@ class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co,
def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
def __contains__(self, item: object) -> bool: ...
def __iter__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
def __or__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
def __ror__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ...
def __sub__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ...
@@ -674,7 +673,6 @@ class KeysView(MappingView, AbstractSet[_KT_co]):
def __rand__(self, other: Iterable[_T]) -> set[_T]: ...
def __contains__(self, key: object) -> bool: ...
def __iter__(self) -> Iterator[_KT_co]: ...
def __reversed__(self) -> Iterator[_KT_co]: ...
def __or__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
def __ror__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ...
def __sub__(self, other: Iterable[Any]) -> set[_KT_co]: ...
@@ -686,7 +684,6 @@ class ValuesView(MappingView, Collection[_VT_co]):
def __init__(self, mapping: Mapping[Any, _VT_co]) -> None: ... # undocumented
def __contains__(self, value: object) -> bool: ...
def __iter__(self) -> Iterator[_VT_co]: ...
def __reversed__(self) -> Iterator[_VT_co]: ...
class Mapping(Collection[_KT], Generic[_KT, _VT_co]):
# TODO: We wish the key type could also be covariant, but that doesn't work,