@@ -22,6 +22,7 @@ from typing import ( # noqa: Y022,Y027
22
22
Mapping ,
23
23
NewType as NewType ,
24
24
NoReturn as NoReturn ,
25
+ Sequence ,
25
26
Text as Text ,
26
27
Type as Type ,
27
28
TypeVar ,
@@ -76,8 +77,10 @@ __all__ = [
76
77
"NoReturn" ,
77
78
"Required" ,
78
79
"NotRequired" ,
80
+ "clear_overloads" ,
79
81
"get_args" ,
80
82
"get_origin" ,
83
+ "get_overloads" ,
81
84
"get_type_hints" ,
82
85
]
83
86
@@ -188,10 +191,17 @@ else:
188
191
# New things in 3.11
189
192
if sys .version_info >= (3 , 11 ):
190
193
from typing import (
194
+ LiteralString as LiteralString ,
191
195
Never as Never ,
196
+ NotRequired as NotRequired ,
197
+ Required as Required ,
192
198
Self as Self ,
199
+ TypeVarTuple as TypeVarTuple ,
200
+ Unpack as Unpack ,
193
201
assert_never as assert_never ,
194
202
assert_type as assert_type ,
203
+ clear_overloads as clear_overloads ,
204
+ get_overloads as get_overloads ,
195
205
reveal_type as reveal_type ,
196
206
)
197
207
else :
@@ -200,23 +210,26 @@ else:
200
210
def reveal_type (__obj : _T ) -> _T : ...
201
211
def assert_never (__arg : NoReturn ) -> NoReturn : ...
202
212
def assert_type (__val : _T , __typ : Any ) -> _T : ...
213
+ def clear_overloads () -> None : ...
214
+ def get_overloads (func : Callable [..., object ]) -> Sequence [Callable [..., object ]]: ...
203
215
204
- # Experimental (hopefully these will be in 3.11)
205
- Required : _SpecialForm
206
- NotRequired : _SpecialForm
207
- LiteralString : _SpecialForm
208
- Unpack : _SpecialForm
216
+ Required : _SpecialForm
217
+ NotRequired : _SpecialForm
218
+ LiteralString : _SpecialForm
219
+ Unpack : _SpecialForm
209
220
210
- @final
211
- class TypeVarTuple :
212
- __name__ : str
213
- def __init__ (self , name : str ) -> None : ...
214
- def __iter__ (self ) -> Any : ... # Unpack[Self]
221
+ @final
222
+ class TypeVarTuple :
223
+ __name__ : str
224
+ def __init__ (self , name : str ) -> None : ...
225
+ def __iter__ (self ) -> Any : ... # Unpack[Self]
215
226
227
+ # Experimental (hopefully these will be in 3.11)
216
228
def dataclass_transform (
217
229
* ,
218
230
eq_default : bool = ...,
219
231
order_default : bool = ...,
220
232
kw_only_default : bool = ...,
221
- field_descriptors : tuple [type [Any ] | Callable [..., Any ], ...] = ...,
233
+ field_specifiers : tuple [type [Any ] | Callable [..., Any ], ...] = ...,
234
+ ** kwargs : object ,
222
235
) -> Callable [[_T ], _T ]: ...
0 commit comments