<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>This might help:</div><div><br></div><a href="http://mail.python.org/pipermail/python-dev/2008-June/080111.html">http://mail.python.org/pipermail/python-dev/2008-June/080111.html</a><br><div><div><br></div><div>Here is the most relevant part (quoting Guido):</div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></span></font></div><div><div>&gt; Does it help if I tell you that for "x &lt;binop&gt; y" we always try</div><div>&gt; x.__binop__(y) before trying y.__reverse_binop__(x), *except* in the</div><div>&gt; case where y is an instance of a subclass of the class of x?</div><div><br></div><div>jared</div><div><br></div></div><div>On Sep 22, 2009, at 7:06 AM, Chris Withers wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi All,<br><br>I didn't see any docs on this:<br><br>http://docs.python.org/reference/datamodel.html?highlight=__eq__#object.__eq__<br><br>Where are the specifications on what happens if two objects are compared and both have implementations of __eq__? Which __eq__ is called? What happens if the first one called returns False? Is the second one called? What is one implements __eq__ and the other __ne__?<br><br>If I've missed something, please point me in the right direction.<br><br>To all those about to tell me to go read the source: that's not good enough here. I'm hoping there *are* "official" rules for how these interact and they just need better linking in, otherwise, I worry that IronPython could do one thing, Jython another and CPython a third...<br><br>cheers,<br><br>Chris<br><br>-- <br>Simplistix - Content Management, Batch Processing &amp; Python Consulting<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- http://www.simplistix.co.uk<br>_______________________________________________<br>Python-Dev mailing list<br>Python-Dev@python.org<br>http://mail.python.org/mailman/listinfo/python-dev<br>Unsubscribe: http://mail.python.org/mailman/options/python-dev/jflatow%40gmail.com<br></div></blockquote></div><br></body></html>