Closed
Description
According to numpydoc return value specification, the name for each return value may be optional. If the return value is omitted and the return type can take several types (if the actual type depends on user input, for example), then if the second type contains " :"
as part of the type description (as in the following example) it is incorrectly identified as parameter type separator. This prevents sphinx recognition of the referenced type.
from numpydoc.docscrape import NumpyDocString
docstr="""
Returns
-------
str or :class:`NumpyDocString`
"""
print(NumpyDocString(docstr))
Results with:
Returns
-------
str or : class:`NumpyDocString`
I would expect getting the following result:
Returns
-------
str or :class:`NumpyDocString`
The example is using version 1.4.0.
I think this was changed in #286 .
Thanks!