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 jmg
Recipients jmg
Date 2020-11-19.20:36:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org>
In-reply-to
Content
per: https://bugs.python.org/issue38401

There is not a way to document fields of a dataclass.

I propose that instead of making a language change, that an additional parameter to the field be added in similar vein to property.

This currently works:
```
class Foo:
 def getx(self):
  return 5
 x = property(getx, doc='document the x property')
```

So, I propose this:
```
@dataclass
class Bar:
 x : int = field(doc='document what x is')
```

This should be easy to support as I believe that the above would not require any changes to the core language.
History
Date User Action Args
2020-11-19 20:36:18jmgsetrecipients: + jmg
2020-11-19 20:36:18jmgsetmessageid: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org>
2020-11-19 20:36:18jmglinkissue42414 messages
2020-11-19 20:36:18jmgcreate