>def any(seq): return reduce(bool_or, seq, False)
> def all(seq): return reduce(bool_and, seq, True)
Any other use cases? These will be built-in in 2.5
-Mike
--
http://mail.python.org/mailman/listinfo/python-list
The suggestion is to add boolean and/or functions to the operator
module, useful with "reduce". For some reason I thought these were
already present, but they're not (were they removed?). There are
already and_ and or_, but these are bitwise functions, not boolean
operations.
bool_and and bool_o