Here you go:<div><br></div><div><div>do_except = True</div><div>for i in SEQ:</div><div>  do_except = False</div><div>  A</div><div>else:</div><div>  if not do_except:</div><div>    C  # suite_if_loop_is_not_broken</div><div>

if do_except:</div><div>  B  # suite_if_loop_body_is_not_executed</div><div><br></div><div>--- Bruce</div></div><div><br></div><div><br><br><div class="gmail_quote">On Tue, Oct 6, 2009 at 8:53 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org">guido@python.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Tue, Oct 6, 2009 at 8:46 PM, Bruce Leban <<a href="mailto:bruce@leapyear.org">bruce@leapyear.org</a>> wrote:<br>


> Switching gears a bit, here's what I want:<br>
><br>
> for_stmt ::= "for" target_list "in" expression_list ":" suite_loop_body<br>
> ["except" ":" suite_if_loop_body_is_not_executed] ["else" ":"<br>
> suite_if_loop_is_not_broken]<br>
><br>
> The except and else appear in this order to make it clear that except takes<br>
> precedence. If the loop body is not executed at all then both conditions are<br>
> true but it obviously is only useful if except takes precedence.<br>
> Comments?<br>
<br>
</div></div>I'm sure it's obvious to you what the except clause should do, but it<br>
isn't to me. :-( Assuming you're not proposing we change the meaning<br>
of else in the absence of except, and that its meaning together with<br>
except is a logical extension of this, can you show how we should<br>
translate a for-loop with an except clause into current Python? Say,<br>
what would I be writing today to get the exact effect of your proposed<br>
<br>
for i in SEQ:<br>
  A<br>
except:<br>
  B<br>
else:<br>
  C<br>
<br>
?<br>
<font color="#888888"><br>
--<br>
--Guido van Rossum (home page: <a href="http://www.python.org/~guido/" target="_blank">http://www.python.org/~guido/</a>)<br>
</font></blockquote></div><br></div>