[Python-checkins] python/nondist/peps pep-0308.txt,1.14,1.15
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Tue, 11 Feb 2003 17:38:28 -0800
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv18838
Modified Files:
pep-0308.txt
Log Message:
* Add Holger's new, well-received idea.
* Fixed typo.
Index: pep-0308.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0308.txt,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** pep-0308.txt 11 Feb 2003 22:34:52 -0000 1.14
--- pep-0308.txt 12 Feb 2003 01:38:25 -0000 1.15
***************
*** 37,41 ****
(if <condition>: <expression1> else: <expression2>)
! Note that the enclosing parethesis are not optional.
The resulting expression is evaluated like this:
--- 37,41 ----
(if <condition>: <expression1> else: <expression2>)
! Note that the enclosing parentheses are not optional.
The resulting expression is evaluated like this:
***************
*** 81,84 ****
--- 81,97 ----
<expression1> is long, it's easy to miss the conditional while
skimming.
+
+ ---
+
+ Holger Krekel proposed a new, minimally invasive variant:
+
+ <expression1> and <condition> else <expression2>
+
+ The concept behind it is that a nearly complete ternary operator
+ already exists with and/or and this proposal is the least invasive
+ change that makes it complete. Many respondants on the
+ newsgroup found this to be the most pleasing alternative.
+ However, a couple of respondants were able to post examples
+ that were mentally difficult to parse.
---