missing 'xor' Boolean operator
Jean-Michel Pichavant
jeanmichel at sequans.com
Thu Jul 16 05:06:54 EDT 2009
Nobody wrote:
> On Wed, 15 Jul 2009 21:05:16 +0200, Jean-Michel Pichavant wrote:
>
>
>> So if I resume:
>> - not 'foo' => False
>> - 'foo' or 'foo' => 'foo'
>>
>> I may be missing something, but honestly, Guido must have smoked some
>> heavy stuff to write such logic, has he ?
>>
>
> Several languages (e.g. Lisp, Bourne shell) behave the same way, i.e. "or"
> returns the first element which is considered true while "and" returns the
> last element provided that all preceding elements are considered true.
>
> [snip]
>
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.
JM
More information about the Python-list
mailing list