Docstrings and class Attributes

Ben Finney ben+python at
Tue Aug 9 03:28:37 CEST 2011

Steven D'Aprano <steve+comp.lang.python at> writes:

> Ben Finney wrote:
> > They're an accident of the history that led to their implementation,
> > and of the pre-existing parts that they're built from. There doesn't
> > need to be a point to them (though they might be useful for reasons
> > incidental for the reasons they exist).
> But property() itself explicitly takes a docstring parameter. It is
> that docstring that seems of limited value, except that Eric Snow has
> pointed out that help(instance) will display property help strings.

I had forgotten that there is explicit support for adding a docstring to
the property itself. That does raise the question of why :-/

Oh well, I like the analogy and will find a better place soon to
force-fit it to a technical discussion :-)

 \     Lucifer: “Just sign the Contract, sir, and the Piano is yours.” |
  `\     Ray: “Sheesh! This is long! Mind if I sign it now and read it |
_o__)                                later?” — |
Ben Finney

More information about the Python-list mailing list