Lisp mentality vs. Python mentality

Paul Rubin http
Sun Apr 26 10:05:18 CEST 2009

namekuseijin <namekuseijin.nospam at> writes:
>       return (len(a) == len(b)) and not any(not comp(*t) for t in
> (zip(a, b)))
> plus the zip call enclosed in parentheses got turned into an iterator.

zip in python 2.x always makes a list.  You want itertools.izip.
You could also use itertools.starmap.

More information about the Python-list mailing list