diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index 807e9bc0..0ee979e2 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -251,7 +251,7 @@ def _parse_param_list(self, content, single_element_is_type=False): # Examples: func_f1 :meth:`func_h1` :obj:`~baz.obj_r` :class:`class_j` # is a string describing the function. - _role = r":(?P\w+):" + _role = r":(?P(py:)?\w+):" _funcbacktick = r"`(?P(?:~\w+\.)?[a-zA-Z0-9_\.-]+)`" _funcplain = r"(?P[a-zA-Z0-9_\.-]+)" _funcname = r"(" + _role + _funcbacktick + r"|" + _funcplain + r")" diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index f74a2a58..ff0fe0ae 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -110,6 +110,7 @@ -------- some, other, funcs otherfunc : relationship + :py:meth:`spyder.widgets.mixins.GetHelpMixin.show_object_info` Examples -------- @@ -435,6 +436,8 @@ def test_str(): .. `otherfunc`_ relationship +:py:meth:`spyder.widgets.mixins.GetHelpMixin.show_object_info` + .. Notes ----- @@ -602,6 +605,8 @@ def test_sphinx_str(): .. :obj:`otherfunc` relationship + :py:meth:`spyder.widgets.mixins.GetHelpMixin.show_object_info` + .. .. rubric:: Notes