8000 add OrderedDict.{keys,values,items}().mapping · python/typeshed@0957a1e · GitHub
[go: up one dir, main page]

Skip to content

Commit 0957a1e

Browse files
committed
add OrderedDict.{keys,values,items}().mapping
1 parent 1ec6758 commit 0957a1e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

stdlib/collections/__init__.pyi

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
import sys
22
from _typeshed import Self
3+
from builtins import _dict_items, _dict_keys, _dict_values
34
from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload
45

56
if sys.version_info >= (3, 10):
67
from typing import (
78
Callable,
8-
ItemsView,
99
Iterable,
1010
Iterator,
11-
KeysView,
1211
Mapping,
1312
MutableMapping,
1413
MutableSequence,
1514
Reversible,
1615
Sequence,
17-
ValuesView,
1816
)
1917
else:
2018
from _collections_abc import *
@@ -247,23 +245,23 @@ class Counter(Dict[_T, int], Generic[_T]):
247245
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
248246
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore
249247

250-
class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]):
248+
class _OrderedDictKeysView(_dict_keys[_KT, _VT], Reversible[_KT]):
251249
def __reversed__(self) -> Iterator[_KT]: ...
252250

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

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

259257
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
260258
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
261259
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
262260
def copy(self: _S) -> _S: ...
263261
def __reversed__(self) -> Iterator[_KT]: ...
264-
def keys(self) -> _OrderedDictKeysView[_KT]: ...
262+
def keys(self) -> _OrderedDictKeysView[_KT, _VT]: ...
265263
def items(self) -> _OrderedDictItemsView[_KT, _VT]: ...
266-
def values(self) -> _OrderedDictValuesView[_VT]: ...
264+
def values(self) -> _OrderedDictValuesView[_KT, _VT]: ...
267265

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

0 commit comments

Comments
 (0)
0