Skip to content

Commit d601f14

Browse files
authored
Merge pull request #135 from jnothman/deduplicate
Avoid reprocessing already numpydocced docstrings
2 parents 9d9477f + f902cc7 commit d601f14

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

numpydoc/numpydoc.py

+7
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ def rename_references(app, what, name, obj, options, lines,
6363
reference_offset[0] += len(references)
6464

6565

66+
DEDUPLICATION_TAG = ' !! processed by numpydoc !!'
67+
68+
6669
def mangle_docstrings(app, what, name, obj, options, lines):
70+
if DEDUPLICATION_TAG in lines:
71+
return
6772

6873
cfg = {'use_plots': app.config.numpydoc_use_plots,
6974
'show_class_members': app.config.numpydoc_show_class_members,
@@ -100,6 +105,8 @@ def mangle_docstrings(app, what, name, obj, options, lines):
100105
# duplicates
101106
rename_references(app, what, name, obj, options, lines)
102107

108+
lines += ['..', DEDUPLICATION_TAG]
109+
103110

104111
def mangle_signature(app, what, name, obj, options, sig, retann):
105112
# Do not try to inspect classes that don't define `__init__`

0 commit comments

Comments
 (0)