On May 3, 9:14 am, Steven D'Aprano <st...@remove-this-
cybersource.com.au> wrote:

> If it is any arbitrary object, then "x and True or False" is just an
> obfuscated way of writing "bool(x)". Perhaps their code predates the
> introduction of bools, and they have defined global constants True and
> False but not bool. Then they removed the True and False bindings as no
> longer necessary, but neglected to replace the obfuscated conversion.

Or perhaps they are maintaining code that must run on any 2.X. True
and False would be set up conditional on Python version. Writing
"expression and True or False" avoids a function call.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to