Skip to content

Commit

Permalink
fix: Repetition of prop.getter.doc in prop.doc
Browse files Browse the repository at this point in the history
  • Loading branch information
sizmailov committed Aug 31, 2023
1 parent cece898 commit 407bd9b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pybind11_stubgen/parser/mixins/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,17 @@ def handle_property(self, path: QualifiedName, prop: Any) -> Property | None:
if prop_doc is not None:
result.doc = self._strip_empty_lines(prop_doc.splitlines())

if result.getter is not None and result.getter.doc == result.doc:
if (
result.doc is not None
and result.getter is not None
and (
result.doc == result.getter.doc
or result.doc
== self._strip_empty_lines(
getattr(prop.fget, "__doc__", "").splitlines()
)
)
):
result.doc = None

return result
Expand Down

0 comments on commit 407bd9b

Please sign in to comment.