[Python-Dev] Doc-strings for class attributes ?!

Greg Wilson gvwilson@nevex.com
Mon, 21 Aug 2000 16:48:11 -0400 (EDT)


> Marc-Andre Lemburg wrote:
> We already have doc-strings for modules, classes, functions and
> methods, but there is no support for documenting class attributes in a
> way that:
> 
> 1. is local to the attribute definition itself
> 2. doesn't affect the attribute object
> 3. behaves well under class inheritence
> 4. is available online
> 
> [proposal]
> class C:
>         " class C doc-string "
> 
>         a = 1
>         " attribute C.a doc-string "
> 
>         b = 2
>         " attribute C.b doc-string "
>
> What do you think about this idea ?

Greg Wilson:
I think it would be useful, but as we've discussed elsewhere, I think that
if the doc string mechanism is going to be extended, I would like it to
allow multiple chunks of information to be attached to objects (functions,
modules, class variables, etc.), so that different developers and tools
can annotate programs without colliding.

Thanks,
Greg