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/092425.html below:

[Python-Dev] Announcing PEP 3136

[Python-Dev] Announcing PEP 3136 [Python-Dev] Announcing PEP 3136Terry Reedy tjreedy at udel.edu
Thu Oct 1 01:47:21 CEST 2009
Yuvgoog Greenle 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".

Properly understood, no ambiguity.

while c:
   x()

is equivalent to hypothetical

label z:
if c:
   x()
   goto: z

So

while c:
   x()
else:
   y()

is equivalent to

label 1:
if c:
   x()
   goto: 1
else"
   y()

The else clause fires (once) if and when the if/while condition 
evaluates as false. Break and continue are restricted *unconditional* 
goto statements, and so *cannot* trigger an else clause.

In for loops, the implied condition is 'there is another item in the 
collection represented by the iterable'.

For any more, move to another list.

Terry Jan Reedy

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