In message
<[email protected]>, Paul 
McGuire wrote:

> While sifting through some code looking for old "x and y or z" code
> that might better be coded using "y if x else z", I came across this
> puzzler:
> 
>     x = <boolean expression> and True or False

I suspect the “boolean expression” isn’t actually evaluating to a Boolean at 
all, this is simply a long-winded way of converting values that Python 
treats as “false” (e.g. None, 0, what else?) to actual False, and everything 
else to True.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to