MCPcopy Index your code
hub / github.com/python/mypy / is_staticmethod

Method is_staticmethod

mypy/stubgenc.py:568–576  ·  view source on GitHub ↗
(self, class_info: ClassInfo | None, name: str, obj: object)

Source from the content-addressed store, hash-verified

566 return inspect.ismethod(obj)
567
568 def is_staticmethod(self, class_info: ClassInfo | None, name: str, obj: object) -> bool:
569 if class_info is None:
570 return False
571 elif self.is_c_module:
572 raw_lookup: Mapping[str, Any] = getattr(class_info.cls, "__dict__") # noqa: B009
573 raw_value = raw_lookup.get(name, obj)
574 return isinstance(raw_value, staticmethod)
575 else:
576 return isinstance(inspect.getattr_static(class_info.cls, name), staticmethod)
577
578 @staticmethod
579 def is_abstract_method(obj: object) -> bool:

Callers 2

generate_class_stubMethod · 0.95

Calls 3

getattrFunction · 0.85
isinstanceFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected