Python-list Digest, Vol 64, Issue 697

AJ Ostergaard aj at cubbyhole.net
Sat Jan 31 14:11:46 EST 2009


> AJ Ostergaard wrote:
>> I'm not suggesting it's not operating as advertised - I'm  
>> suggesting the
>> 'advertising' is slightly sguiffy if you catch my drift. I guess it's
>> just me that finds it slightly counter intuitive. Surely  
>> intuitively the
>> expression is "and" and therefore should always return a boolean?
>>
> You might think so, and it wouldn't be an entirely unreasonable  
> thought,
> but in practice it makes a lot of sense to retain the original value
> where possible.
>
> The fact is that any left-hand operand that evaluates to false in a
> Boolean context can be used as it stands rather than being converted  
> to
> Boolean first. So the conversion is essentially useless processing.

That's what I've figured out during the course of the day.

Thanks for listening one and all! :)

Regards,
AJ




More information about the Python-list mailing list