[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Best way to specify docstrings for member objects

> On Mar 20, 2019, at 3:59 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Hmm.  Said somewhat less snarkily, is there a more general solution to the problem of absent docstrings or do we have to attack this problem piece-by-piece?

I think this is the last piece.  The pydoc help() utility already knows how to find docstrings for other class level descriptors:  property, class method, staticmethod.

Enum() already has nice looking help() output because the class variables are assigned values that have a nice __repr__, making them self documenting.

By design, dataclasses aren't special -- they just make regular classes, similar to or better than you would write by hand.