Skip to content

Commit

Permalink
Regex should not match functions in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 11, 2024
1 parent 06a6270 commit 90ae5f1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions documenters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ def parse_signature_blocks(self, docstring):
current_sig = ""
current_desc = ""
for line in docstring.split("\n"):
match = re.match(
r"^\s*\w+(\([^)]*\)(?:\s*->\s*[^:\n]+)?)\s*((?:(?!\w+\().)*)\s*$", line
)
match = re.match(r"^\w+(\([^)]*\)(?:\s*->\s*[^:\n]+)?)\s*((?:(?!\w+\().)*)\s*$", line)
if match:
if current_sig:
res.append((current_sig, current_desc))
Expand Down

0 comments on commit 90ae5f1

Please sign in to comment.