Speed of attribute lookup (was Re: advice on programming style: is multiple inheritance bad?)

Aahz aahz at pythoncraft.com
Thu Feb 19 20:10:17 EST 2004


In article <101sphfjk91p42d at news.supernews.com>,
John Roth <newsgroups at jhrothjr.com> wrote:
>"Aahz" <aahz at pythoncraft.com> wrote in message
>news:bvkh00$38r$1 at panix1.panix.com...
>> 
>> The problem with attribute lookup in new-style classes is that any
>> instance attribute could be a property.  So if Python finds an attribute
>> on the instance, it needs to traverse the MRO to check if there's a
>> property.  If there isn't one, that's an expensive waste.
>
>I thought about that when new style classes came out, and managed
>to convince myself that it couldn't happen, at least with data
>properties. Unless trying to set the *same* attribute from the setter
>invoked from the property actually works? That seems like a lot of work
>to make it function poorly.

I'm not understanding your question.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Argue for your limitations, and sure enough they're yours."  --Richard Bach



More information about the Python-list mailing list