I've seen this proposed before, but it is, as you said, a bit
arduous.
For dataclasses specifically, there is also another possibility:
add a `doc` argument to dataclasses.field. Like this:
from dataclasses import dataclass, field
@dataclass
class A:
x: int = field(doc="Docstring for x.")
y: bool = field(default=False, doc="Docstring for y.")
And then it would be retrievable with dataclasses.fields(A).
Thomas
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/K7VUWXZQYPUMTRT5S553HRFVDHC2LDRJ/
Code of Conduct: http://python.org/psf/codeofconduct/