[Python-checkins] python/nondist/peps pep-0340.txt,1.10,1.11

gvanrossum at users.sourceforge.net gvanrossum at users.sourceforge.net
Fri Apr 29 19:13:26 CEST 2005


Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31649

Modified Files:
	pep-0340.txt 
Log Message:
Mention else-clauses; the else-clause on the translation of the
for-loop was broken, and the break-statement probabyl shouldn't have
one.


Index: pep-0340.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0340.txt,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- pep-0340.txt	29 Apr 2005 15:23:34 -0000	1.10
+++ pep-0340.txt	29 Apr 2005 17:13:08 -0000	1.11
@@ -150,8 +150,6 @@
 
         for VAR1 in EXPR1:
             BLOCK1
-        else:
-            BLOCK2
 
     will be translated as follows:
 
@@ -164,14 +162,16 @@
                 break
             arg = None
             BLOCK1
-        else:
-            BLOCK2
 
     (However, 'itr' and 'arg' are hidden from the user, their scope
     ends when the while-loop is exited, and they are not shared with
     nested or outer for-loops, and the user cannot override the
     built-ins referenced.)
 
+    I'm leaving the translation of an else-clause up to the reader;
+    note that you can't simply affix the else-clause to the while-loop
+    since it is always broken out.
+
 Specification: the Extended 'continue' Statement
 
     In the translation of the for-loop, inside BLOCK1, the new syntax
@@ -286,6 +286,12 @@
     the limitations of all finalization semantics) that the block will
     be resumed eventually.
 
+    I haven't decided yet whether the block-statement should also
+    allow an optional else-clause, like the for-loop.  I think it
+    would be confusing, and emphasize the "loopiness" of the
+    block-statement, while I want to emphasize its *difference* from a
+    for-loop.
+
 Specification: Generator Exception Handling
 
     Generators will implement the new __next__() method API, as well
@@ -618,9 +624,9 @@
     Lundh, Greg Ewing, Holger Krekel, Jason Diamond, Jim Jewett,
     Josiah Carlson, Ka-Ping Yee, Michael Chermside, Michael Hudson,
     Neil Schemenauer, Nick Coghlan, Paul Moore, Phillip Eby, Raymond
-    Hettinger, Samuele Pedroni, Shannon Behrens, Steven Bethard, Terry
-    Reedy, Tim Delaney, Aahz, and others.  Thanks all for the valuable
-    discussion and ideas!
+    Hettinger, Samuele Pedroni, Shannon Behrens, Skip Montanaro,
+    Steven Bethard, Terry Reedy, Tim Delaney, Aahz, and others.
+    Thanks all for the valuable contributions!
 
 References
 



More information about the Python-checkins mailing list