Skip to content

Commit f1c984f

Browse files
committed
Fix a bug where in python <3.10 static methods are not extracted properly.
1 parent f190f9c commit f1c984f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hyperdiv_docs/extractor/extractor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from .types import get_types
2626
from .top_level_docs import get_top_level_docs
2727
from .class_attribute_docs import get_class_attribute_docs
28-
from ..utils import render_value, render_value_list
28+
from ..utils import render_value_list
2929

3030

3131
class Extractor:
@@ -170,7 +170,6 @@ def extract_component(self, comp):
170170
can be either a Hyperdiv exported function, like
171171
`hd.global_state` or `hd.cache`, or a component class.
172172
"""
173-
174173
# If already extracted, do nothing.
175174
if comp.__name__ in self.output["components"]:
176175
return
@@ -204,10 +203,12 @@ def extract_component(self, comp):
204203
is_mixin = not issubclass(comp, Component)
205204

206205
# Collect info for all the class attributes
207-
for name, attr in vars(comp).items():
206+
for name in vars(comp).keys():
208207
if name.startswith("_"):
209208
continue
210209

210+
attr = getattr(comp, name)
211+
211212
# The class attribute is a prop
212213
if isinstance(attr, Prop):
213214
prop_doc = self.get_prop_doc(comp, attr.name)

0 commit comments

Comments
 (0)