Does Python need an 'xor' operator?

Martin v. Loewis martin at v.loewis.de
Sat Apr 13 18:39:34 EDT 2002


"Ken Peek" <Ken.Peek at SpiritSongDesigns.comNOSPAM> writes:

> I think an 'xor' operator is needed.  The 'xor' operator means
> 'logical-exclusive-or', and returns a 1 or 0.

In Python 2.3, you will be able to write

   bool(a) ^ bool(b)

Seems pretty clear to me.

Regards,
Martin



More information about the Python-list mailing list