Lisp mentality vs. Python mentality

Arnaud Delobelle arnodel at googlemail.com
Sun Apr 26 10:14:55 CEST 2009


Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:

> namekuseijin <namekuseijin.nospam at gmail.com> writes:
>> ...     return (len(a) == len(b)) and not any(not comp(a,b) for (a,b)
>> in (zip(a, b)))
>
> If I'm reading that correctly, I think I'd write it as:
>    
>      from itertools import imap, izip
>      return (len(a) == len(b)) and all(imap(comp, izip(a, b)))

Do you mean imap(comp, a, b)?

-- 
Arnaud



More information about the Python-list mailing list