-1<div><br></div><div>It would be unnice in my opinion because it would falsely suggest some kind of parallelism with how 'and' and 'or' work.</div><div><br></div><div>Just use bool(x) ^ bool(y) if you really want xor behavior:</div>

<div><br></div><div><div>>>> bool(3) ^ bool(4)</div><div>False</div><div><div>>>> bool(3) ^ bool(None)</div><div>True</div></div><br>--- Bruce<br><a href="http://www.vroospeak.com">http://www.vroospeak.com</a><br>


<br><br><div class="gmail_quote">On Tue, Oct 27, 2009 at 3:48 PM, Chris Rebert <span dir="ltr"><<a href="mailto:pyideas@rebertia.com">pyideas@rebertia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Tue, Oct 27, 2009 at 3:41 PM, Sturla Molden <<a href="mailto:sturla@molden.no">sturla@molden.no</a>> wrote:<br>
> Why does Python have a bitwise but not a logical xor operator? It's even<br>
> weirder because boolean objects do have a __xor__ method.<br>
<br>
</div>It would be nice for symmetry, but it would be infrequently used<br>
compared to the other operators and is not strictly necessary as<br>
logical XOR cannot and would not short-circuit, unlike logical AND and<br>
OR.<br>
<br>
Cheers,<br>
Chris<br>
<font color="#888888">--<br>
<a href="http://blog.rebertia.com" target="_blank">http://blog.rebertia.com</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</div></div></blockquote></div><br></div>