[issue42414] unable to document fields of dataclass

Andrei Kulakov report at bugs.python.org
Fri Jul 23 16:07:05 EDT 2021


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

I was thinking about adding this to named tuple as well, but it's less useful than with dataclasses because named tuples are simpler and smaller. However if this feature is added to dataclasses and is widely used, it would make a lot of sense to expand it to namedtuples especially if people request that.

I don't think it makes sense for attributes because many attributes are immutable so you can't add a doc attr to them. Additionally, most attrs can be documented via methods that set or update them.

I agree it's a good idea to bring this to Ideas, I'll think about this for a few days and then do that. Thanks!

----------

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


More information about the Python-bugs-list mailing list