[Python-checkins] python/nondist/peps pep-0308.txt,1.6,1.7
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Fri, 07 Feb 2003 18:12:45 -0800
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv18277
Modified Files:
pep-0308.txt
Log Message:
Add 'when' variant.
Index: pep-0308.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0308.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** pep-0308.txt 8 Feb 2003 00:56:13 -0000 1.6
--- pep-0308.txt 8 Feb 2003 02:12:43 -0000 1.7
***************
*** 154,157 ****
--- 154,169 ----
leave x unchanged. So don't even think about this one!
+ ---
+
+ Another variant proposes to use 'when' instead of 'if':
+
+ <expression1> when <condition> else <expression2>
+
+ I don't see the advantage of 'when' over 'if'; it adds a new
+ keyword which is a major extra hurdle to introduce this. I think
+ that using a different keyword suggests that the semantics are
+ different than those of an 'if' statement; but they really aren't
+ (only the syntax is different).
+
Copyright