Why can't I xor strings?

Paul Rubin http
Sun Oct 10 03:12:23 EDT 2004


Ville Vainio <ville at spammers.com> writes:
> 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.

I think != is appropriate in this situation.  
   if bool(x) != bool(y): ...



More information about the Python-list mailing list