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 andrei.avk
Recipients andrei.avk, eric.smith, jmg, rhettinger, terry.reedy
Date 2021-07-20.17:27:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626802067.99.0.797883837008.issue42414@roundup.psfhosted.org>
In-reply-to
Content
I've put up a simple PoC PR adding a __field_doc__ optional dict attr to dataclass, which would add the docs to class docstring:

@dataclass
class A:
    __field_doc__ = dict(num='number of widgets', total='total widgets')
    total: int
    num: int = 5
print(A.__doc__)

OUTPUT
---

A(total: int, num: int = 5)

num: int [5] -- number of widgets

total: int  -- total widgets
History
Date User Action Args
2021-07-20 17:27:48andrei.avksetrecipients: + andrei.avk, rhettinger, terry.reedy, eric.smith, jmg
2021-07-20 17:27:47andrei.avksetmessageid: <1626802067.99.0.797883837008.issue42414@roundup.psfhosted.org>
2021-07-20 17:27:47andrei.avklinkissue42414 messages
2021-07-20 17:27:47andrei.avkcreate