[Python-Dev] operator precedence of eq, ne, etc, if both object have implementations (original) (raw)

Chris Withers chris at simplistix.co.uk
Tue Sep 22 16:06:42 CEST 2009


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



More information about the Python-Dev mailing list