PEP 315: Enhanced While Loop
Neil Hodgson
nhodgson at eb2.net.au
Mon May 5 19:23:34 EDT 2003
Andrew Koenig:
> By implication, there is no obvious reason that one could not write
>
> while <condition1>:
> <code1>
> and while <condition2>:
> <code2>
> and while <condition3>:
> <code3>
> ...
>
> Looking at these examples, I find myself liking the "and while" idea more,
> because it uses (negative) indentation to mark the possible exit points.
Allowing break expressions to dedent would help clarify the current
idiom:
while <condition1>:
<code1>
break if <condition2>:
<code2>
Or to make the colon scan better:
while <condition1>:
<code1>
break if <condition2> else:
<code2>
Neil
More information about the Python-list
mailing list