sphinx-doc / sphinx-doc/sphinx
Remove a docstring from members of namedtuple
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
All members of namedtuple have a similar docstring: "Alias for field number N".
$ python
Python 3.8.1 (default, Feb 13 2020, 13:34:23)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import namedtuple
>>>
>>> Coordinate = namedtuple('Coordinate', 'X Y')
>>> Coordinate.__doc__
'Coordinate(X, Y)'
>>> Coordinate.X.__doc__
'Alias for field number 0'
>>> Coordinate.Y.__doc__
'Alias for field number 1'
This would be helpful for online document tool like help(). But it is a bit redundant for the built document.

Describe the solution you'd like
Remove a docstring from members of namedtuple.
Describe alternatives you've considered
N/A
Additional context
refs: https://chrisdown.name/2015/09/20/removing-namedtuple-docstrings-from-sphinx.html
- [e.g. URL or Ticket]
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
No source file or test is named. Start by reproducing the Python namedtuple example and trace how Sphinx documents namedtuple members; done should mean the generated member docstrings are omitted while the namedtuple class documentation remains available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100