PEP-315 ("do" loop)

Andrew Koenig ark at
Tue Feb 17 20:20:53 CET 2004

> This could be solved by starting with a 'while' construct as normal and
> following it with the new keyword:
>   while True:
>     setup_condition
>   anwhile condition:
>     loop_body
> ('anwhile' is by analogy with 'elif', but anything could be used.)

Hmmm... You could spell it "and while" without needing a new keyword at all.
Moreover, if you were to define "while:" as equivalent to "while True:",
then you could do this:

    and while condition:

No reading backwards needed.

More information about the Python-list mailing list