testing two lists for equality

David Eppstein eppstein at ics.uci.edu
Fri Jun 20 07:14:37 CEST 2003

In article <BswIa.3239$38.1069 at nwrdny01.gnilink.net>,
 "Raymond Hettinger" <vze4rx4y at verizon.net> wrote:

> Do you think docs should be changed from:
>             Tuples and lists are compared lexicographically using
>             comparison of corresponding items.
> To:
>             ... compared by sequentially comparing corresponding items.
> Or something like:
>            ...compared sequentially using comparison of corresponding items

The difference is that "lexicographically" has a recognized precise 
mathematical meaning.  Your alternatives don't convey that meaning to me 
unless you describe what you do with the results of the sequential 
comparisons, e.g.

...compared by comparing corresponding items, sequentially until an 
unequal pair is found, and using the comparison value from that pair.  
If all compared pairs are equal, the result is the same as if the 
lengths of the lists were compared.

But that seems a bit cumbersome to me...

David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science

More information about the Python-list mailing list