|
1 | 1 | import sys
|
2 | 2 | from _typeshed import Self
|
| 3 | +from builtins import _dict_items, _dict_keys, _dict_values |
3 | 4 | from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload
|
4 | 5 |
|
5 | 6 | if sys.version_info >= (3, 10):
|
6 | 7 | from typing import (
|
7 | 8 | Callable,
|
8 |
| - ItemsView, |
9 | 9 | Iterable,
|
10 | 10 | Iterator,
|
11 |
| - KeysView, |
12 | 11 | Mapping,
|
13 | 12 | MutableMapping,
|
14 | 13 | MutableSequence,
|
15 | 14 | Reversible,
|
16 | 15 | Sequence,
|
17 |
| - ValuesView, |
18 | 16 | )
|
19 | 17 | else:
|
20 | 18 | from _collections_abc import *
|
@@ -247,23 +245,23 @@ class Counter(Dict[_T, int], Generic[_T]):
|
247 | 245 | def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
|
248 | 246 | def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore
|
249 | 247 |
|
250 |
| -class _OrderedDictKeysView(KeysView[_KT], Reversible[_KT]): |
| 248 | +class _OrderedDictKeysView(_dict_keys[_KT, _VT], Reversible[_KT]): |
251 | 249 | def __reversed__(self) -> Iterator[_KT]: ...
|
252 | 250 |
|
253 |
| -class _OrderedDictItemsView(ItemsView[_KT, _VT], Reversible[Tuple[_KT, _VT]]): |
| 251 | +class _OrderedDictItemsView(_dict_items[_KT, _VT], Reversible[Tuple[_KT, _VT]]): |
254 | 252 | def __reversed__(self) -> Iterator[Tuple[_KT, _VT]]: ...
|
255 | 253 |
|
256 |
| -class _OrderedDictValuesView(ValuesView[_VT], Reversible[_VT]): |
| 254 | +class _OrderedDictValuesView(_dict_values[_KT, _VT], Reversible[_VT]): |
257 | 255 | def __reversed__(self) -> Iterator[_VT]: ...
|
258 | 256 |
|
259 | 257 | class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
260 | 258 | def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
|
261 | 259 | def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
|
262 | 260 | def copy(self: _S) -> _S: ...
|
263 | 261 | def __reversed__(self) -> Iterator[_KT]: ...
|
264 |
| - def keys(self) -> _OrderedDictKeysView[_KT]: ... |
| 262 | + def keys(self) -> _OrderedDictKeysView[_KT, _VT]: ... |
265 | 263 | def items(self) -> _OrderedDictItemsView[_KT, _VT]: ...
|
266 |
| - def values(self) -> _OrderedDictValuesView[_VT]: ... |
| 264 | + def values(self) -> _OrderedDictValuesView[_KT, _VT]: ... |
267 | 265 |
|
268 | 266 | class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
269 | 267 | default_factory: Callable[[], _VT] | None
|
|
0 commit comments