@@ -20,7 +20,7 @@ from _typeshed import (
20
20
SupportsWrite ,
21
21
)
22
22
from io import BufferedRandom , BufferedReader , BufferedWriter , FileIO , TextIOWrapper
23
- from types import CodeType , MappingProxyType , TracebackType
23
+ from types import CodeType , TracebackType
24
24
from typing import (
25
25
IO ,
26
26
AbstractSet ,
@@ -32,10 +32,8 @@ from typing import (
32
32
Callable ,
33
33
FrozenSet ,
34
34
Generic ,
35
- ItemsView ,
36
35
Iterable ,
37
36
Iterator ,
38
- KeysView ,
39
37
Mapping ,
40
38
MutableMapping ,
41
39
MutableSequence ,
@@ -56,12 +54,12 @@ from typing import (
56
54
Type ,
57
55
TypeVar ,
58
56
Union ,
59
- ValuesView ,
60
57
overload ,
61
58
)
62
59
from typing_extensions import Literal , SupportsIndex , TypeGuard , final
63
60
64
61
from _ast import AST
62
+ from _collections_abc import dict_items , dict_keys , dict_values
65
63
66
64
if sys .version_info >= (3 , 9 ):
67
65
from types import GenericAlias
@@ -74,8 +72,6 @@ _T_co = TypeVar("_T_co", covariant=True)
74
72
_T_contra = TypeVar ("_T_contra" , contravariant = True )
75
73
_KT = TypeVar ("_KT" )
76
74
_VT = TypeVar ("_VT" )
77
- _KT_co = TypeVar ("_KT_co" , covariant = True ) # Key type covariant containers.
78
- _VT_co = TypeVar ("_VT_co" , covariant = True ) # Value type covariant containers.
79
75
_S = TypeVar ("_S" )
80
76
_T1 = TypeVar ("_T1" )
81
77
_T2 = TypeVar ("_T2" )
@@ -809,18 +805,6 @@ class list(MutableSequence[_T], Generic[_T]):
809
805
if sys .version_info >= (3 , 9 ):
810
806
def __class_getitem__ (cls , __item : Any ) -> GenericAlias : ...
811
807
812
- class _dict_keys (KeysView [_KT_co ], Generic [_KT_co , _VT_co ]):
813
- if sys .version_info >= (3 , 10 ):
814
- mapping : MappingProxyType [_KT_co , _VT_co ]
815
-
816
- class _dict_values (ValuesView [_VT_co ], Generic [_KT_co , _VT_co ]):
817
- if sys .version_info >= (3 , 10 ):
818
- mapping : MappingProxyType [_KT_co , _VT_co ]
819
-
820
- class _dict_items (ItemsView [_KT_co , _VT_co ], Generic [_KT_co , _VT_co ]):
821
- if sys .version_info >= (3 , 10 ):
822
- mapping : MappingProxyType [_KT_co , _VT_co ]
823
-
824
808
class dict (MutableMapping [_KT , _VT ], Generic [_KT , _VT ]):
825
809
@overload
826
810
def __init__ (self : dict [_KT , _VT ]) -> None : ...
@@ -845,9 +829,9 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
845
829
def update (self , __m : Iterable [tuple [_KT , _VT ]], ** kwargs : _VT ) -> None : ...
846
830
@overload
847
831
def update (self , ** kwargs : _VT ) -> None : ...
848
- def keys (self ) -> _dict_keys [_KT , _VT ]: ...
849
- def values (self ) -> _dict_values [_KT , _VT ]: ...
850
- def items (self ) -> _dict_items [_KT , _VT ]: ...
832
+ def keys (self ) -> dict_keys [_KT , _VT ]: ...
833
+ def values (self ) -> dict_values [_KT , _VT ]: ...
834
+ def items (self ) -> dict_items [_KT , _VT ]: ...
851
835
@classmethod
852
836
@overload
853
837
def fromkeys (cls , __iterable : Iterable [_T ], __value : None = ...) -> dict [_T , Any | None ]: ...