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 <1570535809.61.0.275195380836.issue38401@roundup.psfhosted.org>
In-reply-to
Content
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
    3

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.
History
Date User Action Args
2019-10-08 11:56:49eric.smithsetrecipients: + eric.smith, docs@python, John Parejko2
2019-10-08 11:56:49eric.smithsetmessageid: <1570535809.61.0.275195380836.issue38401@roundup.psfhosted.org>
2019-10-08 11:56:49eric.smithlinkissue38401 messages
2019-10-08 11:56:49eric.smithcreate