Trailing underscores in types
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 355
- Forks
- 181
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 3
Description
Trailing underscores in types in the Parameters and Returns sections have to be escaped in order to not give an Unknown target name warning.
Examples that DON'T work :
def identity(object_):
"""Identity function.
Parameters
----------
object_ : Any
Returns
-------
object_ : type(object_)
Just `object_` again.
"""
return object_
The returns section
Returns
-------
type(object_)
Just `object_` again.
Without a name doesn't work either. In both cases, I have to write type(object\_).
I don't know if this is fixable like it was for parameter names (#63). I guess types are actually supposed to be links sometimes, in contrast to parameter names? Feel free to close if that is the case and there's just not really a possible fix.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Unknown target name warning with the Parameters and Returns examples in the issue. Compare the existing handling described in issue #63 and inspect how numpydoc parses parameter and return types. Done means the shown trailing-underscore forms work without manual escaping while valid type links remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100