Python code for 2.5 and 2.4?

Paul Rubin http
Mon Feb 25 18:17:44 EST 2008


Arnaud Delobelle <arnodel at googlemail.com> writes:
>     def all(iterable):
>         for x in iterable:
>             if not x: return False
>         return True

from itertools import imap
def all(iterable):
   return False not in imap(bool, iterable)

def any(iterable):
   return True in imap(bool, iterable)



More information about the Python-list mailing list