@@ -4,35 +4,68 @@ import sys
4
4
import typing
5
5
from _collections_abc import dict_items , dict_keys , dict_values
6
6
from _typeshed import IdentityFunction , Incomplete
7
- from collections . abc import Iterable
8
- from typing import ( # noqa: Y022,Y039
7
+ from typing import ( # noqa: Y022,Y037,Y038,Y039
8
+ IO as IO ,
9
9
TYPE_CHECKING as TYPE_CHECKING ,
10
+ AbstractSet as AbstractSet ,
10
11
Any as Any ,
12
+ AnyStr as AnyStr ,
11
13
AsyncContextManager as AsyncContextManager ,
12
14
AsyncGenerator as AsyncGenerator ,
13
15
AsyncIterable as AsyncIterable ,
14
16
AsyncIterator as AsyncIterator ,
15
17
Awaitable as Awaitable ,
16
- Callable ,
18
+ BinaryIO as BinaryIO ,
19
+ Callable as Callable ,
17
20
ChainMap as ChainMap ,
18
21
ClassVar as ClassVar ,
22
+ Collection as Collection ,
23
+ Container as Container ,
19
24
ContextManager as ContextManager ,
20
25
Coroutine as Coroutine ,
21
26
Counter as Counter ,
22
27
DefaultDict as DefaultDict ,
23
28
Deque as Deque ,
24
- Mapping ,
29
+ Dict as Dict ,
30
+ ForwardRef as ForwardRef ,
31
+ FrozenSet as FrozenSet ,
32
+ Generator as Generator ,
33
+ Generic as Generic ,
34
+ Hashable as Hashable ,
35
+ ItemsView as ItemsView ,
36
+ Iterable as Iterable ,
37
+ Iterator as Iterator ,
38
+ KeysView as KeysView ,
39
+ List as List ,
40
+ Mapping as Mapping ,
41
+ MappingView as MappingView ,
42
+ Match as Match ,
43
+ MutableMapping as MutableMapping ,
44
+ MutableSequence as MutableSequence ,
45
+ MutableSet as MutableSet ,
25
46
NoReturn as NoReturn ,
26
- Sequence ,
47
+ Optional as Optional ,
48
+ Pattern as Pattern ,
49
+ Reversible as Reversible ,
50
+ Sequence as Sequence ,
51
+ Set as Set ,
52
+ Sized as Sized ,
27
53
SupportsAbs as SupportsAbs ,
28
54
SupportsBytes as SupportsBytes ,
29
55
SupportsComplex as SupportsComplex ,
30
56
SupportsFloat as SupportsFloat ,
31
57
SupportsInt as SupportsInt ,
32
58
SupportsRound as SupportsRound ,
33
59
Text as Text ,
60
+ TextIO as TextIO ,
61
+ Tuple as Tuple ,
34
62
Type as Type ,
63
+ Union as Union ,
64
+ ValuesView as ValuesView ,
35
65
_Alias ,
66
+ cast as cast ,
67
+ no_type_check as no_type_check ,
68
+ no_type_check_decorator as no_type_check_decorator ,
36
69
overload as overload ,
37
70
type_check_only ,
38
71
)
@@ -109,6 +142,45 @@ __all__ = [
109
142
"get_original_bases" ,
110
143
"get_overloads" ,
111
144
"get_type_hints" ,
145
+ "AbstractSet" ,
146
+ "AnyStr" ,
147
+ "BinaryIO" ,
148
+ "Callable" ,
149
+ "Collection" ,
150
+ "Container" ,
151
+ "Dict" ,
152
+ "ForwardRef" ,
153
+ "FrozenSet" ,
154
+ "Generator" ,
155
+ "Generic" ,
156
+ "Hashable" ,
157
+ "IO" ,
158
+ "ItemsView" ,
159
+ "Iterable" ,
160
+ "Iterator" ,
161
+ "KeysView" ,
162
+ "List" ,
163
+ "Mapping" ,
164
+ "MappingView" ,
165
+ "Match" ,
166
+ "MutableMapping" ,
167
+ "MutableSequence" ,
168
+ "MutableSet" ,
169
+ "Optional" ,
170
+ "Pattern" ,
171
+ "Reversible" ,
172
+ "Sequence" ,
173
+ "Set" ,
174
+ "Sized" ,
175
+ "TextIO" ,
176
+ "Tuple" ,
177
+ "Union" ,
178
+ "ValuesView" ,
179
+ "cast" ,
180
+ "get_protocol_members" ,
181
+ "is_protocol" ,
182
+ "no_type_check" ,
183
+ "no_type_check_decorator" ,
112
184
]
113
185
114
186
_T = typing .TypeVar ("_T" )
@@ -403,3 +475,9 @@ else:
403
475
# Not actually a Protocol at runtime; see
404
476
# https://github.com/python/typeshed/issues/10224 for why we're defining it this way
405
477
def __buffer__ (self , __flags : int ) -> memoryview : ...
478
+
479
+ if sys .version_info >= (3 , 13 ):
480
+ from typing import get_protocol_members as get_protocol_members , is_protocol as is_protocol
481
+ else :
482
+ def is_protocol (__tp : type ) -> bool : ...
483
+ def get_protocol_members (__tp : type ) -> frozenset [str ]: ...
0 commit comments