This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author John Parejko2
Recipients John Parejko2, docs@python
Date 2019-10-08.00:24:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1570494293.05.0.934356434949.issue38401@roundup.psfhosted.org>
In-reply-to
Content
Dataclasses provide a very straightforward way to specify structured data. One can trivally document a dataclass's attributes via triple-quoted attribute docstrings per PEP 257. However, those docstrings are not accessible to pydoc, so they are lost to users of the dataclass.

For example, the attribute docstrings in the below dataclass should be available when looking at `help(SpectralData)`, but that help command does not show the docstrings.

```
@dataclasses.dataclass
class SpectralData:
    """Class to hold data and metadata from a fiber spectrograph."""
    wavelength: astropy.units.Quantity
    """The wavelength array produced by the instrument."""
    spectrum: np.ndarray
    """The flux array in instrumental units."""
    duration: float
    """The duration of the exposure in seconds."""
```
History
Date User Action Args
2019-10-08 00:24:53John Parejko2setrecipients: + John Parejko2, docs@python
2019-10-08 00:24:53John Parejko2setmessageid: <1570494293.05.0.934356434949.issue38401@roundup.psfhosted.org>
2019-10-08 00:24:52John Parejko2linkissue38401 messages
2019-10-08 00:24:52John Parejko2create