[Python-Dev] cmp(x,x)

Gustavo Niemeyer niemeyer at conectiva.com
Fri May 21 13:36:54 EDT 2004


Hello again Armin,

> > Performance is certainly a legitimate concern.
> 
> Ok, then the current situation looks like the best one.  I suggest we
> just drop a note in the documentation saying that if there are objects
> for which x.__eq__(x) isn't necessarily true, you shouldn't expect
> them to be handled in a fully consistent way.

Is it true that the current list comparison algorithm
goes trough every element doing identity comparison, and
if every element in the first list *is* the element at
the same position in the second list, and the list has
the same size, then lists are considered equal?

If that's true, then I belive there's no reason for
not comparing if the first list *is* the second list at
the top of list_richcompare(), right?

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the Python-Dev mailing list