[Python-ideas] for/else statements considered harmful

Carl M. Johnson cmjohnson.mailinglist at gmail.com
Fri Jun 8 05:14:42 CEST 2012


On Jun 7, 2012, at 5:52 AM, Alice Bevan–McGregor wrote:

> Well, how about:
> 
>   for <var> in <iterable>:
>       pass # process each <var>
>   except:  # no arguments!
>       pass # nothing to process
>   else:
>       pass # fell through
>   finally:
>       pass # regardless of break/fallthrough/empty

Finally is redundant, but what about an `except break:` as the opposite of `else`?


More information about the Python-ideas mailing list