27 Oct
2009
27 Oct
'09
6:18 p.m.
On Tue, Oct 27, 2009 at 6:41 PM, Sturla Molden <sturla@molden.no> wrote:
Why does Python have a bitwise but not a logical xor operator?
.. because it does: !=
True != True False True != False 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.