"Michael Spencer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Fahri Basegmez wrote: >> 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 >> >> > TypeError: unsupported operand type(s) for |: 'NoneType' and 'bool' > > operator.or_ is "|" i.e., bitwise, not logical or > > Michael >
That explains it. Is there a logical or we can use with reduce? Fahri -- http://mail.python.org/mailman/listinfo/python-list