On Sun, 26 Apr 2009 05:07:25 -0700, bearophileHUGS wrote: > Paul Rubin: >> Arnaud Delobelle: >> > Do you mean imap(comp, a, b)? >> >> Oh yes, I forgot you can do that. Thanks. > > That works and is nice and readable: > > > import operator > from itertools import imap > > def equal_sequences(a, b, comp=operator.eq): [snip]
Sorry, this is worse than unreadable. It is *misleading*. It doesn't test for equal sequences except as a special case. What it does is perform a generic element-by-element comparison, not necessarily an equality test. What was wrong with the name compare() used in previous posts in this thread? -- Steven -- http://mail.python.org/mailman/listinfo/python-list