On Mon, Jul 16, 2012 at 11:21 AM, Ranting Rick
<rantingrickjohn...@gmail.com> wrote:
> If HOWEVER we want to "truth test" an object (as in: "if obj") we
> should be FORCED to use the bool! Why? Because explicit is better than
> implicit and readability counts if we want to create maintainable code
> bases!
>
> if bool(obj) and a==b: # Correct!
> if obj and a==b:       # Incorrect!

That still doesn't answer the question of what bool(obj) should do if
obj is not a bool, and why if can't do the exact same thing, since if,
by definition, is looking for a boolean state selector.

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

Reply via email to