PEP-0315--Enhanced While Loop: An idea for an alternative syntax

Paul Rubin http
Wed Feb 18 12:03:19 EST 2004


"Andrew Koenig" <ark at acm.org> writes:
> Any loop that is currently written in the form
> 
>     while True:
>         <statements>
>         if condition:
>             break
>         more statements

If the loop is complicated enough, it's probably easier to just write
it the way you've written it there.  If it's uncomplicated, there's
probably a way to do it with iterators, assignment expressions, or
whatever.  Got a real world example that really benefits from the new
construction?



More information about the Python-list mailing list