A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-September/091953.html below:

[Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

[Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementationsChris 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4