[Python-Dev] cmp(x,x)

Michael Chermside mcherm at mcherm.com
Fri May 21 11:07:53 EDT 2004


Armin Rigo writes:
> Unless there are serious objections I suggest to (i.e. I plan to) remove the
> short-cut in PyObject_RichCompareBool() -- performance is probably not an
> issue here -- and then review all built-in comparison methods and make sure
> that they return "equal" for identical objects.

Robert H. Ledwith writes:
> I have a serious objection to this because it is a major performance
> problem.

Performance is certainly a legitimate concern. But wouldn't your
performance problems be fixed just as well if the tuple class implemented
"identical-objects-are-immediately-equal" instead of putting it in the
general comparison logic for all objects? Because if I understand
correctly, that's what Armin is suggesting. Tuples would still be
compared just as rapidly.

-- Michael Chermside




More information about the Python-Dev mailing list