Skip to content

Commit d2b943e

Browse files
committed
Fix python C sigangure $ issues. Revert removal of star test.
1 parent 56d621b commit d2b943e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Diff for: numpydoc/numpydoc.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ def mangle_signature(app, what, name, obj, options, sig, retann):
206206
sig = doc['Signature'] or getattr(obj, '__text_signature__', None)
207207
if sig:
208208
sig = re.sub("^[^(]*", "", sig)
209-
sig = re.sub("$", "", sig)
209+
sig = re.sub(r"\$self,\s", "", sig)
210+
sig = re.sub(r"\/,\s", "", sig)
210211
return sig, ''
211212

212213

Diff for: numpydoc/tests/test_docscrape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def my_func(a, b, **kwargs):
699699
pass
700700

701701
fdoc = FunctionDoc(func=my_func)
702-
assert fdoc['Signature'] == 'my_func(a, b, **kwargs)'
702+
assert fdoc['Signature'] == ''
703703

704704

705705
doc4 = NumpyDocString(

Diff for: numpydoc/tests/test_full.py

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_MyClass(sphinx_app):
5353
html = fid.read()
5454
# ensure that no autodoc weirdness ($) occurs
5555
assert '$self' not in html
56+
assert '/,' not in html
5657
assert '__init__' in html # inherited
5758
# escaped * chars should no longer be preceded by \'s,
5859
# if we see a \* in the output we know it's incorrect:

0 commit comments

Comments
 (0)