Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Replace string comparison by isinstance
  • Loading branch information
Marcel Weiler committed Jan 8, 2024
commit 14fd95c8cc78df421e91e1144da7381177eefa96
2 changes: 1 addition & 1 deletion mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def is_staticmethod(self, class_info: ClassInfo | None, name: str, obj: object)
elif self.is_c_module:
raw_lookup: Mapping[str, Any] = getattr(class_info.cls, "__dict__") # noqa: B009
raw_value = raw_lookup.get(name, obj)
return type(raw_value).__name__ == "staticmethod"
return isinstance(raw_value, staticmethod)
else:
return isinstance(inspect.getattr_static(class_info.cls, name), staticmethod)

Expand Down