Currently, there is no way to add docstrings to fields in dataclasses. PEP257
talks about attribute docstrings (a string literal following an assignment),
but these are visual only and not accessible at runtime. My suggestion would be
a simple `doc` or `docstring` parameter to dataclasses.field(). Currently the
best way to get anything close to this is using metadata, which is much
clunkier: `dataclasses.field(metadata={'docstring': 'my description'})`
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/RHB6XFGFVM66AZTRKNTBAKFEVVEYUDD3/
Code of Conduct: http://python.org/psf/codeofconduct/