returning True, False or None

Fahri Basegmez fbasegmezatbcdidotcom
Fri Feb 4 22:38:46 EST 2005


reduce(lambda x, y: x or y, lst)

works but when I tried

import operator
reduce(operator.or_, lst)

this did not work.  It pukes

Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: unsupported operand type(s) for |: 'NoneType' and 'bool'

Any comments?

Fahri





More information about the Python-list mailing list