[issue42414] unable to document fields of dataclass

Andrei Kulakov report at bugs.python.org
Tue Jul 20 16:51:09 EDT 2021


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

John-Mark: yep, it's just a draft patch for now.

It doesn't need to be two lines; it can be updated to start with an empty dict and perhaps use a shorter special name for the doc dict and then you can do:

f1:int = 1
FDOC['f1'] = 'foo'

f2:str = 'a'
FDOC['f2'] = 'bar'

... the nice thing is that you have the flexibility to either group all docs into one place or set them after each field, I can imagine many users will prefer the former.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42414>
_______________________________________


More information about the Python-bugs-list mailing list