A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-October/092550.html below:

[Python-Dev] Announcing PEP 3136

[Python-Dev] Announcing PEP 3136 [Python-Dev] Announcing PEP 3136Karen Tracey kmtracey at gmail.com
Thu Oct 1 03:50:25 CEST 2009
On Wed, Sep 30, 2009 at 5:15 PM, Yuvgoog Greenle <ubershmekel at gmail.com>wrote:

> I like how python has a minimalistic and powerful syntax (-1 for the break
> ___ PEP).
> Also, I really dislike the for/else ambiguity "butterflies".
> When is the else after a loop executed? 1. When the loop isn't entered at
> all.
> 2. When the loop terminates through exhaustion of the list (does this
> include when the list was empty?)
> 3. When the loop didn't exit because of a break statement.
>
> HINTS: The way django does it is opposite the way python does it and there
> may be more than one correct answer.
>
>
Django's template language does not have for/else, it has for/empty:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#for-empty

This construct did come from an external snippet that used 'else' instead of
'empty'.  However when it was moved into Django the 'else' name was
specifically rejected because it did the opposite of what for/else does in
Python.

Karen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090930/ea11e595/attachment.htm>
More information about the Python-Dev mailing list

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