Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upnumpydoc: Return types without description not displayed correctly #54
Comments
kernc
added
the
bug
label
Apr 30, 2019
kernc
changed the title
Return types without description not displayed correctly.
numpydoc: Return types without description not displayed correctly
Apr 30, 2019
This comment has been minimized.
This comment has been minimized.
|
I had a look at how this could be fixed. As far as I can see one would have to handle it as a special case similar to what is done with the _re_returns = re.compile(r"^(?<=Returns\n-{7}\n)(?P<type>[^\n]*)(?=(\Z|\n\Z|\n[^ ]))", re.MULTILINE)
def _rep_returns(match):
return '{}\n DUMMY DESRIPTION TO REMOVE'.format(match.group('type'))
def to_html(text):
text = _re_returns.sub(_rep_returns, text)
text = _to_html(text, module=module, link=link)
text = text.replace('<dd>DUMMY DESRIPTION TO REMOVE</dd>', '')
return tex |
This comment has been minimized.
This comment has been minimized.
|
I, too, thought it probably wouldn't go without special casing. I'd be interested in a solution involving md→md transformation like the one for See Also. In fact, a Returns section with a single return type without description is not that different from See Also section with a single reference ... |
This comment has been minimized.
This comment has been minimized.
True. But at first I thought that
is rendered correctly when in fact it is not. |
This comment has been minimized.
This comment has been minimized.
|
Right. |
rkaminsk commentedApr 30, 2019
I am using numpydoc style docstrings. But when undocumented return types are used, then the type is displayed as normal text. For example in:
When adding a description, then it is rendered correctly:
I am using pdoc 0.5.4.