MCPcopy Create free account
hub / github.com/python/mypy / is_method

Method is_method

mypy/stubgenc.py:548–557  ·  view source on GitHub ↗
(self, class_info: ClassInfo, name: str, obj: object)

Source from the content-addressed store, hash-verified

546 return inspect.isfunction(obj)
547
548 def is_method(self, class_info: ClassInfo, name: str, obj: object) -> bool:
549 if self.is_c_module:
550 return inspect.ismethoddescriptor(obj) or type(obj) in (
551 type(str.index),
552 type(str.__add__),
553 type(str.__new__),
554 )
555 else:
556 # this is valid because it is only called on members of a class
557 return inspect.isfunction(obj)
558
559 def is_classmethod(self, class_info: ClassInfo, name: str, obj: object) -> bool:
560 if self.is_c_module:

Callers 1

generate_class_stubMethod · 0.95

Calls 1

typeClass · 0.85

Tested by

no test coverage detected