Docstrings and class Attributes

Ben Finney ben+python at benfinney.id.au
Mon Aug 8 21:28:37 EDT 2011


Steven D'Aprano <steve+comp.lang.python at pearwood.info> 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?” —http://www.achewood.com/ |
Ben Finney



More information about the Python-list mailing list