[PEP 224] Attribute Docstrings

Frank Niessink frankn=nuws at cs.vu.nl
Sun Aug 27 07:11:45 EDT 2000


M.-A. Lemburg <mal at lemburg.com> wrote:
> Even though the implementation won't go into Python 2.0, it

[snip]

>     The following name mangling scheme achieves all of the above:
>         __doc__<attributename>__


It is my understanding that in the long run, every object in Python
will become a 'real' object. If that is the case, wouldn't the naming
scheme <attributename>.__doc__ be a better one?

So if:

class C:
  a = 1
  """Description of a."""

then:

C.a.__doc__ == "Description of a."


That would prevent another name mangling scheme... 

Cheers, Frank

-- 
Arthur yawed wildly as his skin tried to jump one way and his skeleton the
other, whilst his brain tried to work out which of his ears it most wanted to
crawl out of.
	-- Douglas Adams, 'Life, the Universe, and Everything'



More information about the Python-list mailing list