Why can't I xor strings?

Fredrik Lundh fredrik at pythonware.com
Sun Oct 10 11:20:15 CEST 2004


Ville Vainio wrote:

>     Grant> I don't know what you mean by that.  Nobody seems to have a
>     Grant> problem with "and" "or" and "not" operators using the truth
>     Grant> values of strings.  What is there about "xor" that
>     Grant> precludes it from behaving similarly?
>
> It's just that logical xor is an extremely rare beast. I would
> probably prefer to see the operation expanded to the more typical
> and-or-nots in real code.

"imp" and "eqv", anyone?

</F>






More information about the Python-list mailing list