missing 'xor' Boolean operator

Hrvoje Niksic hniksic at xemacs.org
Wed Jul 15 12:14:10 EDT 2009


Jean-Michel Pichavant <jeanmichel at sequans.com> writes:

> While everyone's trying to tell the OP how to workaround the missing
> xor operator, nobody answered the question "why is there no [boolean]
> xor operator ?".

Probably because there isn't one in C.  The bitwise XOR operator, on the
other hand, exists in both C and Python.

> If the question was "Why is there no 'or' operator ?", would "because
> A or B <=> not(not A and not B)" be a proper answer ?

Note that in Python A or B is in fact not equivalent to not(not A and
not B).



More information about the Python-list mailing list