I agree with Phillip with regard to the semantics.&nbsp; They are semantically desirable.&nbsp; However,&nbsp;<span class="gmail_quote"><b class="gmail_sendername"></b></span>there is a patch to add a mro cache to speed up these sorts of cases on the Python tracker, originally submitted by Armin Rigo.&nbsp; He saw ~20% speedups, others see less.&nbsp; It is currently just sitting there with no apparent activity.&nbsp; So if the overhead of mro lookups is that bothersome, it may be well worth your time to review the patch.
<br><br>URL: <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1700288&amp;group_id=5470&amp;atid=305470">http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1700288&amp;group_id=5470&amp;atid=305470
</a><br><br>-Kevin<br><br><br><div><span class="gmail_quote">On 6/9/07, <b class="gmail_sendername">Phillip J. Eby</b> &lt;<a href="mailto:pje@telecommunity.com">pje@telecommunity.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
At 12:23 AM 6/10/2007 +0300, Eyal Lotem wrote:<br>&gt;A. It will break code that uses instance.__dict__[&#39;var&#39;] directly,<br>&gt;when &#39;var&#39; exists as a property with a __set__ in the class. I believe<br>&gt;this is not significant.
<br>&gt;B. It will simplify getattr&#39;s semantics. Python should _always_ give<br>&gt;precedence to instance attributes over class ones, rather than have<br>&gt;very weird special-cases (such as a property with a __set__).
<br><br>Actually, these are features that are both used and desirable; I&#39;ve<br>been using them both since Python 2.2 (i.e., for many years<br>now).&nbsp;&nbsp;I&#39;m -1 on removing these features from any version of Python, even 
3.0.<br><br><br>&gt;C. It will greatly speed up instance variable access, especially when<br>&gt;the class has a large mro.<br><br>...at the cost of slowing down access to properties and __slots__, by<br>adding an *extra* dictionary lookup there.
<br><br>Note, by the way, that if you want to change attribute lookup<br>semantics, you can always override __getattribute__ and make it work<br>whatever way you like, without forcing everybody else to change *their* code.
<br><br>_______________________________________________<br>Python-Dev mailing list<br><a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev
</a><br>Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/jacobs%40bioinformed.com">http://mail.python.org/mailman/options/python-dev/jacobs%40bioinformed.com</a><br></blockquote></div><br>