(original) (raw)
This might help:
Here is the most relevant part (quoting Guido):
> Does it help if I tell you that for "x <binop> y" we always try
> x.\_\_binop\_\_(y) before trying y.\_\_reverse\_binop\_\_(x), \*except\* in the
> case where y is an instance of a subclass of the class of x?
jared
On Sep 22, 2009, at 7:06 AM, Chris Withers wrote:
Hi All,
I didn't see any docs on this:
http://docs.python.org/reference/datamodel.html?highlight=\_\_eq\_\_#object.\_\_eq\_\_
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\_\_?
If I've missed something, please point me in the right direction.
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...
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/jflatow%40gmail.com