Steven D'Aprano wrote:

> On Tue, 05 Oct 2010 13:57:11 +1100, Ben Finney wrote:
> 
>> chad <cdal...@gmail.com> writes:
>> 
>>> while 1:
>> 
>> A minor point: this is more explanatory and less misleading if you write
>> it as ‘while True’.
> 
> Why is it misleading? Is there some circumstance in Python where the
> literal 1 could have a false value?

Wrong question.

>>> while True:
...     print "forever"
...
>>> True
0

So, if I were to play advocatus diaboli I'd argue that 'while True: ...' is 
more likely to mislead because 'True' could be anything.

Peter

PS: The above is no longer possible in Python 3 where True and False have 
become keywords.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to