[Python-ideas] for/except/else syntax

Bruce Leban bruce at leapyear.org
Wed Oct 7 05:46:58 CEST 2009

Switching gears a bit, here's what I want:

*for_stmt* ::= "for" target_list "in" expression_list ":"
suite_loop_body["except" ":"
suite_if_loop_body_is_not_executed] ["else" ":" suite_if_loop_is_not_broken]

The except and else appear in this order to make it clear that except takes
precedence. If the loop body is not executed at all then both conditions are
true but it obviously is only useful if except takes precedence.


--- Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20091006/730b07da/attachment.html>

More information about the Python-ideas mailing list