@@ -40,7 +40,7 @@ class _Cell:
40
40
41
41
# Make sure this class definition stays roughly in line with `builtins.function`
42
42
@final
43
- class FunctionType :
43
+ class FunctionType ( Callable ) :
44
44
__closure__ : tuple [_Cell , ...] | None
45
45
__code__ : CodeType
46
46
__defaults__ : tuple [Any , ...] | None
@@ -279,7 +279,7 @@ class _StaticFunctionType:
279
279
def __get__ (self , obj : object | None , type : type | None ) -> FunctionType : ...
280
280
281
281
@final
282
- class MethodType :
282
+ class MethodType ( Callable ) :
283
283
__closure__ : tuple [_Cell , ...] | None # inherited from the added function
284
284
__defaults__ : tuple [Any , ...] | None # inherited from the added function
285
285
__func__ : _StaticFunctionType
@@ -290,7 +290,7 @@ class MethodType:
290
290
def __call__ (self , * args : Any , ** kwargs : Any ) -> Any : ...
291
291
292
292
@final
293
- class BuiltinFunctionType :
293
+ class BuiltinFunctionType ( Callable ) :
294
294
__self__ : object | ModuleType
295
295
__name__ : str
296
296
__qualname__ : str
@@ -300,14 +300,14 @@ BuiltinMethodType = BuiltinFunctionType
300
300
301
301
if sys .version_info >= (3 , 7 ):
302
302
@final
303
- class WrapperDescriptorType :
303
+ class WrapperDescriptorType ( Callable ) :
304
304
__name__ : str
305
305
__qualname__ : str
306
306
__objclass__ : type
307
307
def __call__ (self , * args : Any , ** kwargs : Any ) -> Any : ...
308
308
def __get__ (self , obj : Any , type : type = ...) -> Any : ...
309
309
@final
310
- class MethodWrapperType :
310
+ class MethodWrapperType ( Callable ) :
311
311
__self__ : object
312
312
__name__ : str
313
313
__qualname__ : str
@@ -316,14 +316,14 @@ if sys.version_info >= (3, 7):
316
316
def __eq__ (self , other : Any ) -> bool : ...
317
317
def __ne__ (self , other : Any ) -> bool : ...
318
318
@final
319
- class MethodDescriptorType :
319
+ class MethodDescriptorType ( Callable ) :
320
320
__name__ : str
321
321
__qualname__ : str
322
322
__objclass__ : type
323
323
def __call__ (self , * args : Any , ** kwargs : Any ) -> Any : ...
324
324
def __get__ (self , obj : Any , type : type = ...) -> Any : ...
325
325
@final
326
- class ClassMethodDescriptorType :
326
+ class ClassMethodDescriptorType ( Callable ) :
327
327
__name__ : str
328
328
__qualname__ : str
329
329
__objclass__ : type
@@ -424,9 +424,7 @@ if sys.version_info >= (3, 9):
424
424
def __getattr__ (self , name : str ) -> Any : ... # incomplete
425
425
426
426
if sys .version_info >= (3 , 10 ):
427
- @final
428
- class NoneType :
429
- def __bool__ (self ) -> Literal [False ]: ...
427
+ NoneType = type (None )
430
428
EllipsisType = ellipsis # noqa F811 from builtins
431
429
from builtins import _NotImplementedType
432
430
0 commit comments