Author eric.smith
Recipients John Parejko2, docs@python, eric.smith
Date 2019-10-08.11:56:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Note that those strings are not docstrings, per se. They're just strings, and aren't available in the class definition for the dataclass decorator to see. It's really no different from:

class X:
    x: int

That 3 just gets evaluated and thrown away, like the strings in your example. To change this is beyond the scope of dataclasses, and would need to be a language change. I can't think of a good way to attach the string to the annotation before it (I'm assuming this would only work with annotations, but maybe you have other ideas). You might want to bring this up on python-ideas to get some more feedback.
Date User Action Args
2019-10-08 11:56:49eric.smithsetrecipients: + eric.smith, docs@python, John Parejko2
2019-10-08 11:56:49eric.smithsetmessageid: <>
2019-10-08 11:56:49eric.smithlinkissue38401 messages
2019-10-08 11:56:49eric.smithcreate