Status of PEPs?

Ville Vainio ville at spammers.com
Fri Jul 2 06:43:08 EDT 2004


>>>>> "Thomas" == Thomas Reichelt <XXNOSPAMXX at gibts.net> writes:

    >> while 1:
    >> do stuff
    >> if condition:
    >> break

    Thomas> Well, in my opinion this kind of defeats the purpose of a
    Thomas> while-loop. The original intention is to test the
    Thomas> condition in the while-statement, and not to set up an

Original intention for whom? You can imagine "while 1:" as an alias
for "loop:", i.e. an eternal loop.

The distrust of 'while 1' just needs to be unlearned, which is a
matter of education. 

    Thomas> infinite loop and break out somewhere. The behavior of
    Thomas> while (1) { } even generates a warning in other
    Thomas> languages...

That's because 1 is not a conditional statement. It needs to be
spelled out as "while(true)", or "for (;;)" in boolean-challenged old
c++.

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list