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/2011-April/111072.html below:

[Python-Dev] PyObject_RichCompareBool identity shortcut

[Python-Dev] PyObject_RichCompareBool identity shortcut [Python-Dev] PyObject_RichCompareBool identity shortcutTerry Reedy tjreedy at udel.edu
Thu Apr 28 22:48:48 CEST 2011
On 4/28/2011 12:55 PM, Guido van Rossum wrote:

> *If* my proposal gets accepted, there will be a blanket rule that no
> matter how exotic an type's __eq__ is defined, self.__eq__(self)
> (i.e., __eq__ called with the same *object* argument) must return True
> if the type's __eq__ is to be considered well-behaved;

This, to me, is a statement of the obvious ;-), but it should be stated 
in the docs.

Do you also propose to make NaNs at least this well-behaved or leave 
them ill-behaved?

 > and Python
> containers may assume (for the purpose of optimizing their own
> comparison operations) that their elements have a well-behaved __eq__.

This almost states the status quo of the implementation, and the doc 
needs to be updated correspondingly. I do not think we should let object 
ill-behavior infect containers, so that they also become ill-behaved 
(not equal to themselves).

-- 
Terry Jan Reedy

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