@@ -132,9 +132,6 @@ if sys.version_info >= (3, 12):
132132ContextManager = AbstractContextManager
133133AsyncContextManager = AbstractAsyncContextManager
134134
135- # This itself is only available during type checking
136- def type_check_only (func_or_cls : _F ) -> _F : ...
137-
138135Any = object ()
139136
140137def final (f : _T ) -> _T : ...
@@ -183,12 +180,6 @@ class _SpecialForm:
183180 def __or__ (self , other : Any ) -> _SpecialForm : ...
184181 def __ror__ (self , other : Any ) -> _SpecialForm : ...
185182
186- _F = TypeVar ("_F" , bound = Callable [..., Any ])
187- _P = _ParamSpec ("_P" )
188- _T = TypeVar ("_T" )
189-
190- def overload (func : _F ) -> _F : ...
191-
192183Union : _SpecialForm
193184Generic : _SpecialForm
194185# Protocol is only present in 3.8 and later, but mypy needs it unconditionally
@@ -295,6 +286,10 @@ if sys.version_info >= (3, 10):
295286else :
296287 def NewType (name : str , tp : Any ) -> Any : ...
297288
289+ _F = TypeVar ("_F" , bound = Callable [..., Any ])
290+ _P = _ParamSpec ("_P" )
291+ _T = TypeVar ("_T" )
292+
298293# These type variables are used by the container types.
299294_S = TypeVar ("_S" )
300295_KT = TypeVar ("_KT" ) # Key type.
@@ -304,9 +299,13 @@ _KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers.
304299_VT_co = TypeVar ("_VT_co" , covariant = True ) # Value type covariant containers.
305300_TC = TypeVar ("_TC" , bound = type [object ])
306301
302+ def overload (func : _F ) -> _F : ...
307303def no_type_check (arg : _F ) -> _F : ...
308304def no_type_check_decorator (decorator : Callable [_P , _T ]) -> Callable [_P , _T ]: ...
309305
306+ # This itself is only available during type checking
307+ def type_check_only (func_or_cls : _F ) -> _F : ...
308+
310309# Type aliases and type constructors
311310
312311class _Alias :
0 commit comments