New submission from John-Mark Gurney <j...@funkthat.com>:

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.

----------
messages: 381455
nosy: jmg
priority: normal
severity: normal
status: open
title: unable to document fields of dataclass

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to