missing 'xor' Boolean operator

Grant Edwards invalid at invalid
Thu Jul 16 10:04:34 EDT 2009


On 2009-07-16, Emile van Sebille <emile at fenx.com> wrote:
> On 7/16/2009 2:06 AM Jean-Michel Pichavant said...
>> Ok then, why "or" does not return True, if the first element is 
>> considered True ? Why returning the element itself. Any reason for that 
>> ? Because it's confusing, maybe people used to that logic find it 
>> obvious, but I really don't.
>
> For example, I sometimes use it to set defaults:
>
> daysInAdvance = int(inputVar) or 25

I don't get it.  That doesn't work right when inputVar == "0".

-- 
Grant Edwards                   grante             Yow! What I want to find
                                  at               out is -- do parrots know
                               visi.com            much about Astro-Turf?



More information about the Python-list mailing list