Indicate the rejection of PEP 308 for an if-then-else expression.

This commit is contained in:
Raymond Hettinger 2003-08-13 18:06:34 +00:00
parent d16439822f
commit 83923d5309
2 changed files with 135 additions and 3 deletions

View File

@ -109,7 +109,6 @@ Index by Category
S 304 Controlling Generation of Bytecode Files Montanaro
S 305 CSV File API Montanaro, et al
S 307 Extensions to the pickle protocol GvR, Peters
S 308 If-then-else expression GvR, Hettinger
S 309 Built-in Curry Type Harris
S 310 Reliable Acquisition/Release Pairs Hudson, Moore
S 312 Simple Implicit Lambda Suzi, Martelli
@ -184,6 +183,7 @@ Index by Category
SR 271 Prefixing sys.path by command line option Giacometti
SR 289 Generator Comprehensions Hettinger
SR 295 Interpretation of multiline string constants Koltsov
SR 308 If-then-else expression GvR, Hettinger
SD 316 Programming by Contract for Python Way
SR 317 Eliminate Implicit Exception Instantiation Taschuk
SR 666 Reject Foolish Indentation Creighton
@ -320,7 +320,7 @@ Numerical Index
S 305 CSV File API Montanaro, et al
I 306 How to Change Python's Grammar Hudson
S 307 Extensions to the pickle protocol GvR, Peters
S 308 If-then-else expression GvR, Hettinger
SR 308 If-then-else expression GvR, Hettinger
S 309 Built-in Curry Type Harris
S 310 Reliable Acquisition/Release Pairs Hudson, Moore
SF 311 Simplified GIL Acquisition for Extensions Hammond

View File

@ -3,7 +3,7 @@ Title: If-then-else expression
Version: $Revision$
Last-Modified: $Date$
Author: Guido van Rossum, Raymond D. Hettinger
Status: Draft
Status: Rejected
Type: Standards Track
Content-Type: text/plain
Created: 7-Feb-2003
@ -30,6 +30,13 @@ Introduction
overview of proposed alternatives, the state of the curent
discussion, and a discussion of short-circuit behavior.
Following the discussion, a vote was held. While there was an overall
interest in having some form of if-then-else expressions, no one
format was able to draw majority support. Accordingly, the PEP was
rejected due to the lack of an overwhelming majority for change.
Also, a Python design principle has been to prefer the status quo
whenever there are doubts about which path to take.
Proposal
@ -237,6 +244,131 @@ Short-Circuit Behavior
for an if-then-else construct to be added to the language.
Detailed Results of Voting
Votes rejecting all options: 82
Votes with rank ordering: 436
---
Total votes received: 518
ACCEPT REJECT TOTAL
--------------------- --------------------- -----
Rank1 Rank2 Rank3 Rank1 Rank2 Rank3
Letter
A 51 33 19 18 20 20 161
B 45 46 21 9 24 23 168
C 94 54 29 20 20 18 235
D 71 40 31 5 28 31 206
E 7 7 10 3 5 32
F 14 19 10 7 17 67
G 7 6 10 1 2 4 30
H 20 22 17 4 10 25 98
I 16 20 9 5 5 20 75
J 6 17 5 1 10 39
K 1 6 4 13 24
L 1 2 3 3 9
M 7 3 4 2 5 11 32
N 2 3 4 2 11
O 1 6 5 1 4 9 26
P 5 3 6 1 5 7 27
Q 18 7 15 6 5 11 62
Z 1 1
--- --- --- --- --- --- ----
Total 363 286 202 73 149 230 1303
RejectAll 82 82 82 246
--- --- --- --- --- --- ----
Total 363 286 202 155 231 312 1549
CHOICE KEY
----------
A. x if C else y
B. if C then x else y
C. (if C: x else: y)
D. C ? x : y
E. C ? x ! y
F. cond(C, x, y)
G. C ?? x || y
H. C then x else y
I. x when C else y
J. C ? x else y
K. C -> x else y
L. C -> (x, y)
M. [x if C else y]
N. ifelse C: x else y
O. <if C then x else y>
P. C and x else y
Q. any write-in vote
Detail for write-in votes and their ranking:
--------------------------------------------
3: Q reject y x C elsethenif
2: Q accept (C ? x ! y)
3: Q reject ...
3: Q accept ? C : x : y
3: Q accept (x if C, y otherwise)
3: Q reject ...
3: Q reject NONE
1: Q accept select : (<c1> : <val1>; [<cx> : <valx>; ]* elseval)
2: Q reject if C: t else: f
3: Q accept C selects x else y
2: Q accept iff(C, x, y) # "if-function"
1: Q accept (y, x)[C]
1: Q accept C true: x false: y
3: Q accept C then: x else: y
3: Q reject
3: Q accept (if C: x elif C2: y else: z)
3: Q accept C -> x : y
1: Q accept x (if C), y
1: Q accept if c: x else: y
3: Q accept (c).{True:1, False:2}
2: Q accept if c: x else: y
3: Q accept (c).{True:1, False:2}
3: Q accept if C: x else y
1: Q accept (x if C else y)
1: Q accept ifelse(C, x, y)
2: Q reject x or y <- C
1: Q accept (C ? x : y) required parens
1: Q accept iif(C, x, y)
1: Q accept ?(C, x, y)
1: Q accept switch-case
2: Q accept multi-line if/else
1: Q accept C: x else: y
2: Q accept (C): x else: y
3: Q accept if C: x else: y
1: Q accept x if C, else y
1: Q reject choice: c1->a; c2->b; ...; z
3: Q accept [if C then x else y]
3: Q reject no other choice has x as the first element
1: Q accept (x,y) ? C
3: Q accept x if C else y (The "else y" being optional)
1: Q accept (C ? x , y)
1: Q accept any outcome (i.e form or plain rejection) from a usability study
1: Q reject (x if C else y)
1: Q accept (x if C else y)
2: Q reject NONE
3: Q reject NONE
3: Q accept (C ? x else y)
3: Q accept x when C else y
2: Q accept (x if C else y)
2: Q accept cond(C1, x1, C2, x2, C3, x3,...)
1: Q accept (if C1: x elif C2: y else: z)
1: Q reject cond(C, :x, :y)
3: Q accept (C and [x] or [y])[0]
2: Q reject
3: Q reject
3: Q reject all else
1: Q reject no-change
3: Q reject deliberately omitted as I have no interest in any other proposal
2: Q reject (C then x else Y)
1: Q accept if C: x else: y
1: Q reject (if C then x else y)
3: Q reject C?(x, y)
Copyright
This document has been placed in the public domain.