Steven D'Aprano <steve-remove-t...@cybersource.com.au> writes:

> Why is it misleading? Is there some circumstance in Python where the 
> literal 1 could have a false value?

It's misleading as to the intent.

> "while 1" was the accepted idiom for infinite loops in Python for many 
> years, before the introduction of bools in (I think) Python 2.2.
[…]

Right. Now that we have boolean literals, they're semantically clearer
when the semantic value one is testing is boolean, not integer.

-- 
 \      “Nothing is more sacred than the facts.” —Sam Harris, _The End |
  `\                                                   of Faith_, 2004 |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to