Guido van Rossum wrote:
See my blog: http://www.artima.com/forums/flat.jsp?forum=106&thread=98196

Do we even need a PEP or is there a volunteer who'll add any() and all() for me?


Surely these can be written easily with existing constructs:

def any(S):
    return reduce(lambda x, y: bool(x or y), filter(None,S), False))

def all(S):
    return reduce(lambda x, y: x and y, map(bool, S), True)

;-)

Michael

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to