Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,12 @@ def is_method(self, class_info: ClassInfo, name: str, obj: object) -> bool:

def is_classmethod(self, class_info: ClassInfo, name: str, obj: object) -> bool:
if self.is_c_module:
return inspect.isbuiltin(obj) or type(obj).__name__ in (
"classmethod",
"classmethod_descriptor",
)
raw_lookup: Mapping[str, Any] = getattr(class_info.cls, "__dict__") # noqa: B009
raw_value = raw_lookup.get(name, obj)
classmethod_descriptor = type(int.__dict__["from_bytes"])
return isinstance(raw_value, (classmethod, classmethod_descriptor))
else:
return inspect.ismethod(obj)
return isinstance(inspect.getattr_static(class_info.cls, name), classmethod)

def is_staticmethod(self, class_info: ClassInfo | None, name: str, obj: object) -> bool:
if class_info is None:
Expand Down