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

Huaiyu Zhu hzhu at users.sourceforge.net
Thu Aug 31 16:56:54 EDT 2000


[M.-A. Lemburg <mal at lemburg.com> wrote]

>> > There's no way you are going to achieve this using dictionaries.

[Aahz Maruch wrote]

>> Maybe I'm dense, but what about
>> 
>> A.__docs__['x'] == " name of the database; override in subclasses ! "
>> A.__docs__['y'] == " run in auto-commit ? "
>> D.__docs__['x'] == """ name of the attached database; note that this must support
>>         transactions
>>     """
>> D.__docs__['y'] == " run in auto-commit ? "
>> 
>> If D.__doc_y__ or D.__docs__['y'] is a reference to A.__docs__['y'],
>> then it's a reference either way.  Conversely, if it's *not* a
>> reference, there's *definitely* no problem.

[M.-A. Lemburg <mal at lemburg.com> wrote]

>Ok, some questions:
>
>How would this be done for mixin classes ? 
>
>What if you change the base classes of D after creation of D ?
>
>How would D.__docs__ get the information about A's y attribute
>and when ?
>

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']?

More generally, is there a situation / distinction that D.__doc_y__ can
handle that D.__docs__['y'] cannot?

Huaiyu



More information about the Python-list mailing list