Does python provide an elegant way to check for \"equality\" of sequences of different types? The following work, but they seem rather ugly and verbose for python code:
This "functional" code should be fast and generic enough for all purposes.
# python 2.6 ≤ x < 3.0 import operator, itertools as it def seq_cmp(seqa, seqb): return all(it.starmap(operator.eq, it.izip_longest(seqa, seqb)))
If on Python 2.5, use the definition for izip_longest from there.