Message381455
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. |
|
Date |
User |
Action |
Args |
2020-11-19 20:36:18 | jmg | set | recipients:
+ jmg |
2020-11-19 20:36:18 | jmg | set | messageid: <1605818178.59.0.432355698283.issue42414@roundup.psfhosted.org> |
2020-11-19 20:36:18 | jmg | link | issue42414 messages |
2020-11-19 20:36:18 | jmg | create | |
|