Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods in slots attribute #1012

Merged
merged 6 commits into from
Sep 18, 2024
Merged
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
12 changes: 12 additions & 0 deletions python/docs/create_api_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ def _load_module_members(module_path: str, namespace: str) -> ModuleMembers:
else "Pydantic" if issubclass(type_, BaseModel) else "Regular"
)
)
if hasattr(type_, "__slots__"):
for func_name, func_type in inspect.getmembers(type_):
if inspect.isfunction(func_type):
functions.append(
FunctionInfo(
name=func_name,
qualified_name=f"{namespace}.{name}.{func_name}",
is_public=not func_name.startswith("_"),
is_deprecated=".. deprecated::"
in (func_type.__doc__ or ""),
)
)
classes_.append(
ClassInfo(
name=name,
Expand Down
Loading