Re: Another proposed proposal: operator.bool_and / bool_or

2006-03-30 Thread Klaas
>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

Another proposed proposal: operator.bool_and / bool_or

2006-03-30 Thread Paul Rubin
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