Does Python need an 'xor' operator?

Martin v. Loewis martin at v.loewis.de
Sun Apr 14 05:06:43 EDT 2002


bokr at oz.net (Bengt Richter) writes:

> >bool(a) ^ bool(b)
> >
> Hm, ^ should probably be != to return bools instead of integers?

It turns out that ^ returns bool if both arguments are bool.

Regards,
Martin



More information about the Python-list mailing list