Peter Otten wrote: > def andmap(predicate, items): > return False not in (predicate(item) for item in items) > > def ormap(predicate, items): > return True in (predicate(items) for item in items)
These are both broken because they imply the test (in e. g. ormap) if True == predicate(item): ... where if predicate(item): ... would be appropriate. Sorry for the garbage post. Follow Felipe's or Scott's recipes. Peter -- http://mail.python.org/mailman/listinfo/python-list