[Python-ideas] Runtime-accessible attribute docstrings – take 2

2021-12-08 Thread tmkehrenberg
A few weeks ago, I proposed on this mailing list to write docstrings for class attributes like this: @dataclass class A: x: int """Docstring for x.""" The main criticism, I think, was that it is weird to have the docstring *below* the attribute. To solve this problem, I propose to introd

[Python-ideas] Runtime-accessible attribute docstrings

2021-11-17 Thread tmkehrenberg
Hi all, I have seen discussion of docstrings for class attributes before on this list, but not with this exact proposal. My motivation is that I have a dataclass for which I want to write docstrings that can be accessed at runtime. In my specific case, the docstrings would be used to create a he