for / while else doesn't make sense

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Fri Jun 3 23:41:40 EDT 2016


On Saturday, June 4, 2016 at 2:22:18 PM UTC+12, Steven D'Aprano wrote:
> and a loop with two or more exits a *trivially different* way:
> 
> for x in seq:
>     do_something()
>     if condition:
>         break
>     if another_condition:
>         break

But that loop has 3 exits, written in two different ways. Why the special case?



More information about the Python-list mailing list