On Tue, Jul 14, 2009 at 11:47 AM, Mark Dickinson<dicki...@gmail.com> wrote: > On Jul 14, 7:25 pm, "Dr. Phillip M. Feldman" <pfeld...@verizon.net> > wrote: >> Current Boolean operators are 'and', 'or', and 'not'. It would be nice to >> have an 'xor' operator as well. > > Hmm. I don't think 'nice' is sufficient. You'd need to make the case > that it's sufficiently useful to justify adding a new keyword 'xor' to > the language; I suspect that would be an uphill struggle. :) > > I'll just note that: > > (1) It's easy to emulate xor: 'x xor y' <-> bool(x) != bool(y)
Using the xor bitwise operator is also an option: bool(x) ^ bool(y) Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list