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!