On Tue, Oct 27, 2009 at 6:41 PM, Sturla Molden firstname.lastname@example.org wrote:
Why does Python have a bitwise but not a logical xor operator?
.. because it does: !=
True != True
True != False
False != False
In 2.x you can even use <> if you like syntactic sugar. :-)
On arbitrary types a xor b is arguably bool(a) != bool(b) rather than simple a != b, but it is rare enough to warrant additional syntax.
I thought I've seen this answered in an FAQ list somewhere.