Skip to content

Commit

Permalink
add OrderedDict.{keys,values,items}().mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinIsland committed Sep 17, 2021
1 parent 1ec6758 commit 490430a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions stdlib/collections/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
from _typeshed import Self
from builtins import _dict_items, _dict_keys, _dict_values
from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload

if sys.version_info >= (3, 10):
Expand Down Expand Up @@ -247,23 +248,23 @@ class Counter(Dict[_T, int], Generic[_T]):
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore

class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]):
class _OrderedDictKeysView(_dict_keys[_KT, _KT], Reversible[_KT]):
def __reversed__(self) -> Iterator[_KT]: ...

class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]):
class _OrderedDictItemsView(_dict_items[_KT, _VT], Reversible[Tuple[_KT, _VT]]):
def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ...

class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]):
class _OrderedDictValuesView(_dict_values[_KT, _VT], Reversible[_VT]):
def __reversed__(self) -> Iterator[_VT]: ...

class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
def copy(self: _S) -> _S: ...
def __reversed__(self) -> Iterator[_KT]: ...
def keys(self) -> _OrderedDictKeysView[_KT]: ...
def keys(self) -> _OrderedDictKeysView[_KT, _VT]: ...
def items(self) -> _OrderedDictItemsView[_KT, _VT]: ...
def values(self) -> _OrderedDictValuesView[_VT]: ...
def values(self) -> _OrderedDictValuesView[_KT, _VT]: ...

class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
default_factory: Callable[[], _VT] | None
Expand Down

0 comments on commit 490430a

Please sign in to comment.