diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index affbb03e..3b1d45db 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -564,7 +564,7 @@ def __init__(self, func, role='func', doc=None, config={}): if func is None: raise ValueError("No function or docstring given") doc = inspect.getdoc(func) or '' - NumpyDocString.__init__(self, doc) + NumpyDocString.__init__(self, doc, config) if not self['Signature'] and func is not None: func, func_name = self.get_func() @@ -578,7 +578,7 @@ def __init__(self, func, role='func', doc=None, config={}): else: argspec = inspect.getargspec(func) signature = inspect.formatargspec(*argspec) - signature = '%s%s' % (func_name, signature.replace('*', r'\*')) + signature = '%s%s' % (func_name, signature) except TypeError: signature = '%s()' % func_name self['Signature'] = signature diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index a14f0649..81b6d024 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -720,7 +720,7 @@ def my_func(a, b, **kwargs): pass fdoc = FunctionDoc(func=my_func) - assert fdoc['Signature'] == r'my_func(a, b, \*\*kwargs)' + assert fdoc['Signature'] == 'my_func(a, b, **kwargs)' doc4 = NumpyDocString( diff --git a/numpydoc/tests/test_full.py b/numpydoc/tests/test_full.py index 788853dd..9fc8fb6b 100644 --- a/numpydoc/tests/test_full.py +++ b/numpydoc/tests/test_full.py @@ -47,7 +47,7 @@ def test_MyClass(sphinx_app): html = fid.read() # escaped * chars should no longer be preceded by \'s, # if we see a \* in the output we know it's incorrect: - assert r'\*' in html # XXX should be "not in", bug! + assert r'\*' not in html # "self" should not be in the parameter list for the class: assert 'self,' in html # XXX should be "not in", bug! # check xref was embedded properly (dict should link using xref):