boolean xor

Steve Holden sholden at holdenweb.com
Thu Jan 11 08:04:05 EST 2001


"Andrew Dalke" <dalke at acm.org> wrote in message
news:93jm0a$lbj$1 at slb7.atl.mindspring.net...
> Delaney, Timothy:
> >This can be done even better ...
> >
> >def xor (a, b):
> > return (not a)!= (not b)
> >
> >getting rid of one negation ;)
>
> Ooh, I like it.  It's even better than my use of
> operator.truth because it doesn't have the function
> call lookup and overhead.
>
Yup, definitely the neatest so far.

regards
 Steve





More information about the Python-list mailing list