PEP 315: Enhanced While Loop

Evan Simpson evan at 4-am.com
Mon May 5 19:11:55 EDT 2003


Andrew Koenig wrote:
> Gareth> This is very elegant. It's a pity that it doesn't work well
> Gareth> for the special case of a "do...while" loop, though.
> 
>         while:
>             <loop body>
>         and while <condition>:
>             pass

I'd be more inclined to go with:

while:
     <loop body>
and while <condition>:
     continue

...just for the way it sounds when read aloud.

Cheers,

Evan @ 4-am







More information about the Python-list mailing list