[issue38401] Make dataclass attribute docstrings accessible

2021-12-29 Thread Erik Gebeshuber
Erik Gebeshuber added the comment: There is some confusion in the answers that I want to clear up: "Attribute docstrings" were suggested in PEP 224 in August 2000 and rejected March 2001: https://www.python.org/dev/peps/pep-0224/ taleinat mentioned already PEP 258 from May 2001, which also c

[issue38401] Make dataclass attribute docstrings accessible

2021-11-05 Thread Václav Brožík
Václav Brožík added the comment: Note that John Parejko is right that the active PEP 257 clearly specifies attribute docstrings. Here is the excerpt: String literals occurring immediately after a simple assignment at the top level of a module, class, or __init__ method are called "attribute

[issue38401] Make dataclass attribute docstrings accessible

2021-06-15 Thread 4-launchpad-kalvdans-no-ip-org
Change by 4-launchpad-kalvdans-no-ip-org : -- nosy: +4-launchpad-kalvdans-no-ip-org ___ Python tracker ___ ___ Python-bugs-list mail

[issue38401] Make dataclass attribute docstrings accessible

2019-10-11 Thread Tal Einat
Tal Einat added the comment: Thanks for this suggestion John! Unfortunately, only the first string literal in the example is a doc-string, and the rest indeed are not. (PEP-258 suggested adding such doc-strings, but it was rejected.) There is currently no standard way to attach a doc-string

[issue38401] Make dataclass attribute docstrings accessible

2019-10-08 Thread Eric V. Smith
Eric V. Smith added the comment: Note that those strings are not docstrings, per se. They're just strings, and aren't available in the class definition for the dataclass decorator to see. It's really no different from: class X: x: int 3 That 3 just gets evaluated and thrown away, li

[issue38401] Make dataclass attribute docstrings accessible

2019-10-07 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue38401] Make dataclass attribute docstrings accessible

2019-10-07 Thread John Parejko
New submission from John Parejko : Dataclasses provide a very straightforward way to specify structured data. One can trivally document a dataclass's attributes via triple-quoted attribute docstrings per PEP 257. However, those docstrings are not accessible to pydoc, so they are lost to users