[Python-Dev] Re: [PEP 224] Attribute Docstrings

Huaiyu Zhu hzhu at users.sourceforge.net
Thu Aug 31 21:38:16 EDT 2000


On Thu, 31 Aug 2000 22:10:38 GMT, Fredrik Lundh <effbot at telia.com> wrote:
>huaiyu zhu wrote:
>> Mabe I'm dense, too, but why should the answers to these questions (whatever
>> they might be) be different between D.__doc_y__ and D.__docs__['y']?
>
>D.__doc_y__ uses the standard attribute search mechanism;
>if the attribute isn't defined in the given class, Python will look
>for it in the base class(es).  in other words, dot notation and
>"getattr" just works...
>
>if __docs__ is an ordinary dictionary (as proposed), that won't
>happen.
>

Cool!  Thanks for such a clear answer.

Huaiyu



More information about the Python-list mailing list