missing 'xor' Boolean operator

Mark Dickinson dickinsm at gmail.com
Wed Jul 15 20:51:44 CEST 2009


On Jul 15, 7:29 pm, Wayne Brehaut <wbreh... at mcsnet.ca> wrote:
> On Tue, 14 Jul 2009 11:47:41 -0700 (PDT), Mark Dickinson <dicki... at gmail.com> wrote:
> >I'd also guess that 'xor' would be much less used than 'and' or 'or',
> >but maybe that's just a reflection of the sort of code that I tend to
> >write.
>
> You're right about that!. It's used everywhere in:
> [snip examples and references]

Those examples are (almost) all about the *bitwise* xor operator,
which exists in Python ('^') and, as you point out, has no shortage of
good uses.  The discussion was about a *logical* xor, to parallel the
existing 'and' and 'or' operators.

--
Mark



More information about the Python-list mailing list