Fredrik Lundh wrote: > > Aahz Maruch wrote: > > I need a boolean (not bit-wise) xor function. I've got the following > > def xor(a,b): > from operator import truth > return truth(a) ^ truth(b) An aside: does the 'from .. import' statement execute every time the function 'xor' is called, or only during the execution of the 'def' statement?