Skip to content

Commit

Permalink
refactor: tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine DECHAUME committed Jun 6, 2023
1 parent e173ef6 commit 21a073f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/docstring_inheritance/class_docstrings_inheritor.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ def _inherit_attrs_docstrings(

for cls_ in self.__mro_classes:
method = getattr(cls_, attr_name, None)
if method is None:
continue
parent_doc = method.__doc__
if parent_doc is not None:
self._docstring_inheritor(parent_doc, attr)
if method is not None:
parent_doc = method.__doc__
if parent_doc is not None:
self._docstring_inheritor(parent_doc, attr)

@staticmethod
def _create_dummy_func_with_doc(docstring: str | None) -> Callable[..., Any]:
Expand Down

0 comments on commit 21a073f

Please sign in to comment.