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 <>
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.

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."""
Date User Action Args
2019-10-08 00:24:53John Parejko2setrecipients: + John Parejko2, docs@python
2019-10-08 00:24:53John Parejko2setmessageid: <>
2019-10-08 00:24:52John Parejko2linkissue38401 messages
2019-10-08 00:24:52John Parejko2create