Does Python need an 'xor' operator?

phil hunt philh at comuno.freeserve.co.uk
Sun Apr 14 14:01:22 EDT 2002


On 14 Apr 2002 11:06:43 +0200, Martin v. Loewis <martin at v.loewis.de> wrote:
>bokr at oz.net (Bengt Richter) writes:
>
>> >bool(a) ^ bool(b)
>> >
>> Hm, ^ should probably be != to return bools instead of integers?
>
>It turns out that ^ returns bool if both arguments are bool.

And what if one is bool and the other is an int?

-- 
<"><"><"> Philip Hunt <philh at comuno.freeserve.co.uk> <"><"><">
"I would guess that he really believes whatever is politically 
advantageous for him to believe." 
                        -- Alison Brooks, referring to Michael
                              Portillo, on soc.history.what-if



More information about the Python-list mailing list