Thoughts on PEP315

Gordon Airport uce at ftc.gov
Wed Sep 24 03:59:15 CEST 2003


The point of do-while loops is that you don't need setup code anymore, 
right? How about this:

...
dowhile <condition>:
	<loop body>
...

where the body is run once before it becomes a standard while loop. It 
looks like we all think of this structure as a "do-while loop", so the 
expression is natural. This also makes it easy to change loop types - 
just add or remove the "do". Slight downside is that the execution flow 
isn't exactly as you read it.





More information about the Python-list mailing list