Rainer Deyke wrote: >You could, however, remove a redundant 'not' from the original: > >def xor(a, b): return (a or b) and not (a and b) That may find the truthness of a and b twice, which might not give the expected behaviour. Eg, if __nonzero__ takes time to compute (as with a proxy to a remote object) then the overhead may be twice as long. Andrew dalke at acm.org