andmap and ormap

wkehowski at cox.net wkehowski at cox.net
Tue Mar 14 14:45:09 CET 2006


The following works perfectly:

import operator

def andmap(b,L):
    return reduce(operator.and_, [b(x) for x in L])

def ormap(b,L):
    return reduce(operator.or_, [b(x) for x in L]) 

Thanks!




More information about the Python-list mailing list