Python loop constructs
jbperez808 at yahoo.com
Wed Jan 15 05:08:04 CET 2003
In a couple of old threads, "LOOP wisdom found"
and "do...until wisdom found", someone mentioned
that a construct of the type:
if condition: leave
is the cleanest possible solution and that we
can expect to see something like it for "Python 3K".
But doesn't the present 'while' syntax already give
you all that and more?
if condition: break
If one thinks of while 1: as an alias for loop: then
I don't find anything objectionable to its usage at all.
while (condition): do-stuff
would be a lot clearer than:
loop (condition): do-stuff
loop while (condition): do-stuff # YUCK!
More information about the Python-list