@@ -39,7 +39,6 @@ __all__ = [
3939 "AsyncIterator" ,
4040 "Awaitable" ,
4141 "BinaryIO" ,
42- "ByteString" ,
4342 "Callable" ,
4443 "ChainMap" ,
4544 "ClassVar" ,
@@ -110,14 +109,19 @@ __all__ = [
110109 "get_type_hints" ,
111110 "is_typeddict" ,
112111 "no_type_check" ,
113- "no_type_check_decorator" ,
114112 "overload" ,
115113 "runtime_checkable" ,
116114]
117115
116+ if sys .version_info < (3 , 15 ):
117+ __all__ += ["ByteString" , "no_type_check_decorator" ]
118+
118119if sys .version_info >= (3 , 14 ):
119120 __all__ += ["evaluate_forward_ref" ]
120121
122+ if sys .version_info >= (3 , 15 ):
123+ __all__ += ["NoExtraItems" , "TypeForm" , "disjoint_base" ]
124+
121125if sys .version_info >= (3 , 11 ):
122126 __all__ += [
123127 "LiteralString" ,
@@ -258,11 +262,31 @@ if sys.version_info >= (3, 11):
258262 class TypeVarTuple :
259263 @property
260264 def __name__ (self ) -> str : ...
265+ if sys .version_info >= (3 , 15 ):
266+ @property
267+ def __bound__ (self ) -> Any | None : ... # AnnotationForm
268+ @property
269+ def __covariant__ (self ) -> bool : ...
270+ @property
271+ def __contravariant__ (self ) -> bool : ...
272+ @property
273+ def __infer_variance__ (self ) -> bool : ...
261274 if sys .version_info >= (3 , 13 ):
262275 @property
263276 def __default__ (self ) -> Any : ... # AnnotationForm
264277 def has_default (self ) -> bool : ...
265- if sys .version_info >= (3 , 13 ):
278+ if sys .version_info >= (3 , 15 ):
279+ def __new__ (
280+ cls ,
281+ name : str ,
282+ * ,
283+ bound : Any | None = None , # AnnotationForm
284+ covariant : bool = False ,
285+ contravariant : bool = False ,
286+ default : Any = ..., # AnnotationForm
287+ infer_variance : bool = False ,
288+ ) -> Self : ...
289+ elif sys .version_info >= (3 , 13 ):
266290 def __new__ (cls , name : str , * , default : Any = ...) -> Self : ... # AnnotationForm
267291 elif sys .version_info >= (3 , 12 ):
268292 def __new__ (cls , name : str ) -> Self : ...
@@ -397,12 +421,16 @@ _TC = TypeVar("_TC", bound=type[object])
397421def overload (func : _F ) -> _F : ...
398422def no_type_check (arg : _F ) -> _F : ...
399423
400- if sys .version_info >= (3 , 13 ):
401- @deprecated ("Deprecated since Python 3.13; removed in Python 3.15." )
402- def no_type_check_decorator (decorator : Callable [_P , _T ]) -> Callable [_P , _T ]: ...
424+ if sys .version_info < (3 , 15 ):
425+ if sys .version_info >= (3 , 13 ):
426+ @deprecated ("Deprecated since Python 3.13; removed in Python 3.15." )
427+ def no_type_check_decorator (decorator : Callable [_P , _T ]) -> Callable [_P , _T ]: ...
403428
404- else :
405- def no_type_check_decorator (decorator : Callable [_P , _T ]) -> Callable [_P , _T ]: ...
429+ else :
430+ def no_type_check_decorator (decorator : Callable [_P , _T ]) -> Callable [_P , _T ]: ...
431+
432+ if sys .version_info >= (3 , 15 ):
433+ def disjoint_base (cls : _TC ) -> _TC : ...
406434
407435# This itself is only available during type checking
408436def type_check_only (func_or_cls : _FT ) -> _FT : ...
@@ -426,6 +454,13 @@ ChainMap = _Alias()
426454OrderedDict = _Alias ()
427455
428456Annotated : _SpecialForm
457+ if sys .version_info >= (3 , 15 ):
458+ @type_check_only
459+ class _NoExtraItemsType : ...
460+
461+ NoExtraItems : _NoExtraItemsType
462+
463+ TypeForm : _SpecialForm
429464
430465# Predefined type variables.
431466AnyStr = TypeVar ("AnyStr" , str , bytes ) # noqa: Y001
@@ -1147,6 +1182,9 @@ if sys.version_info >= (3, 12):
11471182 def __parameters__ (self ) -> tuple [Any , ...]: ... # AnnotationForm
11481183 @property
11491184 def __name__ (self ) -> str : ...
1185+ if sys .version_info >= (3 , 15 ):
1186+ @property
1187+ def __qualname__ (self ) -> str : ...
11501188 # It's writable on types, but not on instances of TypeAliasType.
11511189 @property
11521190 def __module__ (self ) -> str | None : ... # type: ignore[override]
0 commit comments