[Python-Dev] Adding any() and all() (original) (raw)

Bill Janssen janssen at parc.com
Fri Mar 11 03:38:27 CET 2005


Guido,

I think there should be a PEP. For instance, I think I'd want them to be:

def any(S): for x in S: if x: return x return S[-1]

def all(S): for x in S: if not x: return x return S[-1]

Or perhaps these should be called "first" and "last".

Bill



More information about the Python-Dev mailing list