Skip to content

Commit 89fb6cd

Browse files
authored
Merge pull request #73 from MSeifert04/textsignature-if-no-other
ENH: use __text_signature__ if pydoc.doc does not reveal a signature.
2 parents 701fc3d + 7280356 commit 89fb6cd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

numpydoc/numpydoc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ def mangle_signature(app, what, name, obj, options, sig, retann):
114114
return
115115

116116
doc = SphinxDocString(pydoc.getdoc(obj))
117-
if doc['Signature']:
118-
sig = re.sub(sixu("^[^(]*"), sixu(""), doc['Signature'])
117+
sig = doc['Signature'] or getattr(obj, '__text_signature__', None)
118+
if sig:
119+
sig = re.sub(sixu("^[^(]*"), sixu(""), sig)
119120
return sig, sixu('')
120121

121122

0 commit comments

Comments
 (0)