[Python-Dev] PyObject_RichCompareBool identity shortcut (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Fri Apr 29 01:12:54 CEST 2011


On Fri, Apr 29, 2011 at 2:55 AM, Guido van Rossum <guido at python.org> wrote:

Raymond strongly believes that containers must be allowed to use the modified definition, I believe purely for performance reasons. (Without this rule, a list or tuple could not even cut short being compared to itself.) It seems you are in that camp too.

I'm a fan of the status quo, but not just for performance reasons - there is quite a bit of set theory that breaks once you allow non-reflexive equality*, so it makes sense to me to make it official that containers should ignore any non-reflexivity they come across.

*To all the mathematicians in the audience yelling at their screens that the very idea of "non-reflexive equality" is an oxymoron... yes, I know :P

Cheers, Nick.

P.S. It's hard to explain the slightly odd point of view that seeing standard arithmetic constructed from Peano's Axioms and set theory can give you on discussions like this. It's a seriously different (and strange) way of thinking about the basic arithmetic constructs we normally take for granted, though :)

-- Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-Dev mailing list