A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20090930/ea11e595/attachment.htm below:

On Wed, Sep 30, 2009 at 5:15 PM, Yuvgoog Greenle <span dir="ltr">&lt;<a href="mailto:ubershmekel@gmail.com">ubershmekel@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">I like how python has a minimalistic and powerful syntax (-1 for the break ___ PEP).<div><br></div><div>Also, I really dislike the for/else ambiguity &quot;butterflies&quot;.<div><br></div><div>When is the else after a loop executed?<div>

1. When the loop isn&#39;t entered at all.</div><div>2. When the loop terminates through exhaustion of the list (does this include when the list was empty?)</div><div>3. When the loop didn&#39;t exit because of a break statement.</div>

<div><br></div><div>HINTS: The way django does it is opposite the way python does it and there may be more than one correct answer.<br><br></div></div></div></div></blockquote><div><br>Django&#39;s template language does not have for/else, it has for/empty: <a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for-empty" target="_blank">http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for-empty</a><br>


<br>This construct did come from an external snippet that used &#39;else&#39; instead of &#39;empty&#39;.  However when it was moved into Django the &#39;else&#39; name was specifically rejected because it did the opposite of what for/else does in Python.  <br>
<br>Karen<br></div></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4