Author taleinat
Recipients John Parejko2, docs@python, eric.smith, taleinat
Date 2019-10-11.22:09:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thanks for this suggestion John!

Unfortunately, only the first string literal in the example is a doc-string, and the rest indeed are not. (PEP-258 suggested adding such doc-strings, but it was rejected.)

There is currently no standard way to attach a doc-string to a field in dataclasses, nor in attrs on which dataclasses was mostly based. However, both libraries support custom field meta-data, using which one could add such per-field documentation. So if one really needs something like this, it is possible to work up a custom solution.

Eric is correct that this is far from a straightforward suggestion, which would require a significant language change to implement. Due to the depth of the change required, it would need to be discussed on Python-ideas mailing list first. Please bring this up there if you'd like to pursue this further.

I'm closing this as "rejected" for now since I believe the likelihood of pursuing this to be very small, but this can be re-opened later if further discussion warrants it.
Date User Action Args
2019-10-11 22:09:28taleinatsetrecipients: + taleinat, eric.smith, docs@python, John Parejko2
2019-10-11 22:09:28taleinatsetmessageid: <>
2019-10-11 22:09:28taleinatlinkissue38401 messages
2019-10-11 22:09:28taleinatcreate