[Python-checkins] python/nondist/peps pep-0000.txt, 1.345, 1.346 pep-0308.txt, 1.20, 1.21
rhettinger@users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Sep 30 03:52:02 CEST 2005
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14980
Modified Files:
pep-0000.txt pep-0308.txt
Log Message:
Record pronouncement on conditional expressions.
Index: pep-0000.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v
retrieving revision 1.345
retrieving revision 1.346
diff -u -d -r1.345 -r1.346
--- pep-0000.txt 28 Sep 2005 14:11:28 -0000 1.345
+++ pep-0000.txt 30 Sep 2005 01:51:58 -0000 1.346
@@ -63,6 +63,7 @@
Accepted PEPs (accepted; may not be implemented yet)
+ SA 308 If-then-else expression GvR, Hettinger
SA 328 Imports: Multi-Line and Absolute/Relative Aahz
SA 342 Coroutines via Enhanced Generators GvR, Eby
SA 343 Anonymous Block Redux and Generator Enhancements GvR
@@ -203,7 +204,6 @@
SR 295 Interpretation of multiline string constants Koltsov
SR 296 Adding a bytes Object Type Gilbert
SR 303 Extend divmod() for Multiple Divisors Bellman
- SR 308 If-then-else expression GvR, Hettinger
SR 310 Reliable Acquisition/Release Pairs Hudson, Moore
SD 312 Simple Implicit Lambda Suzi, Martelli
SR 313 Adding Roman Numeral Literals to Python Meyer
@@ -353,7 +353,7 @@
SF 305 CSV File API Montanaro, et al
I 306 How to Change Python's Grammar Hudson
SF 307 Extensions to the pickle protocol GvR, Peters
- SR 308 If-then-else expression GvR, Hettinger
+ SA 308 If-then-else expression GvR, Hettinger
SF 309 Partial Function Application Harris
S 310 Reliable Acquisition/Release Pairs Hudson, Moore
SF 311 Simplified GIL Acquisition for Extensions Hammond
Index: pep-0308.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0308.txt,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- pep-0308.txt 13 Aug 2003 18:06:34 -0000 1.20
+++ pep-0308.txt 30 Sep 2005 01:51:58 -0000 1.21
@@ -3,14 +3,43 @@
Version: $Revision$
Last-Modified: $Date$
Author: Guido van Rossum, Raymond D. Hettinger
-Status: Rejected
+Status: Accepted
Type: Standards Track
Content-Type: text/plain
Created: 7-Feb-2003
Post-History: 7-Feb-2003, 11-Feb-2003
+Adding a conditional expression
-Introduction
+ On 9/29/2005, Guido decided to add conditional expressions in the
+ form of "X if C else Y". [1]
+
+ The motivating use case was the prevalance of error-prone attempts
+ to achieve the same effect using "and" and "or". [2]
+
+ Previous community efforts to add a conditional expression were
+ stymied by a lack of consensus on the best syntax. That issue was
+ resolved by simply deferring to a BDFL best judgment call.
+
+ The decision was validated by reviewing the how the syntax fared when
+ applied throughout the standard library (this review approximates a
+ sampling of real-world use cases, across a variety of applications,
+ written by a number of programmers with diverse backgrounds). [3]
+
+References
+
+ [1] Pronouncement
+ http://mail.python.org/pipermail/python-dev/2005-September/056846.html
+
+ [2] Motivating use case:
+ http://mail.python.org/pipermail/python-dev/2005-September/056546.html
+ http://mail.python.org/pipermail/python-dev/2005-September/056510.html
+
+ [3] Review in the context of real-world code fragments:
+ http://mail.python.org/pipermail/python-dev/2005-September/056803.html
+
+
+Introduction to earlier draft of the PEP (kept for historical purposes)
Requests for an if-then-else ("ternary") expression keep coming up
on comp.lang.python. This PEP contains a concrete proposal of a
More information about the Python-checkins
mailing list