<div dir="ltr"><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, Oct 2, 2009 at 2:14 PM, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
<div><br></div><br>Encouraging people to refer to the idiom as "break/else" and including a<br>SyntaxWarning for dubious usage of loop else clauses (i.e. those without<br>an associated break statement) are probably two fairly low cost<br>
educational steps that could be taken though.<br><div><br></div></blockquote><div> </div></div><div class="gmail_quote">A SyntaxError would be more fitting for py4k but it's still not gonna make the for..else code readable.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Asking people to call this construct a "break/else" is confusing because:</div><div class="gmail_quote">1. "break/else" insinuates the "else" block is for when a break statement _did_ occur.</div>
<div class="gmail_quote">2. the "else" is located immediately after the "for" block. Calling this anything but "for..else" is going to cause a tongue-twisting, mind boggling Stroop effect. IMHO the only way to avoid this is to rename/modify "else" to somehow convey it's relation to the break statement.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div>