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

Improve sphinx.util.inspect [part 1] #12256

Merged
merged 12 commits into from
Apr 13, 2024
4 changes: 2 additions & 2 deletions sphinx/ext/autodoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2438,8 +2438,8 @@ def get_doc(self) -> list[list[str]] | None:
if self.object is SLOTSATTR:
try:
parent___slots__ = inspect.getslots(self.parent)
if parent___slots__ and parent___slots__.get(self.objpath[-1]):
docstring = prepare_docstring(parent___slots__[self.objpath[-1]])
if parent___slots__ and (docstring := parent___slots__.get(self.objpath[-1])):
docstring = prepare_docstring(docstring)
return [docstring]
else:
return []
Expand Down
Loading