Skip to content

Commit

Permalink
Review notes
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrik committed Oct 15, 2023
1 parent d84768c commit b45ce37
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mypy/stubgenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def generate_module(self) -> None:
for name, obj in items:
if self.is_function(obj):
self.generate_function_stub(name, obj, output=functions)
elif self.is_class(obj):
elif inspect.isclass(obj):
self.generate_class_stub(name, obj, output=types)
else:
self.generate_variable_stub(name, obj, output=variables)
Expand Down Expand Up @@ -535,9 +535,6 @@ def is_static_property(self, obj: object) -> bool:
else:
return False

def is_class(self, obj: object) -> bool:
return inspect.isclass(obj) or (self.is_c_module and type(obj) is type(int))

def process_inferred_sigs(self, inferred: list[FunctionSig]) -> None:
for i, sig in enumerate(inferred):
for arg in sig.args:
Expand Down Expand Up @@ -769,7 +766,7 @@ def generate_class_stub(self, class_name: str, cls: type, output: list[str]) ->
ro_properties,
class_info,
)
elif self.is_class(value) and self.is_defined_in_module(value):
elif inspect.isclass(value) and self.is_defined_in_module(value):
self.generate_class_stub(attr, value, types)
else:
attrs.append((attr, value))
Expand Down

0 comments on commit b45ce37

Please sign in to comment.