PEP 308 syntax suggestions -- a matrix-based approach

Carl Banks imbosol-1045251534 at aerojockey.com
Fri Feb 14 14:54:41 EST 2003


Rather than everyone suggesting their own favorite syntax for PEP 308,
we could just break down all the suggestions into manageable parts.

Consider the following conditional in it's C syntax:

a ? b : c


Possibilities for a ? b are:

1) a ? b
2) a ?? b
3) b if a
4) if a: b
5) when a: b
6) a then b
7) cond(a,b
8) if a:(b
9) cond a:(b


Possibilities for _ : c are (where _ is whatever you chose for a ? b):

1) _ : c
2) _ else c
3) _ else: c
4) _ || c
5) _ | c
6) _ ! c
7) _,c)
8) c if not _


The third dimension of this matrix has two possibilities:

1) Parentheses not required
2) Parentheses required


So instead of all these long, silly new syntax suggestions, we can
just site our favorite combination in the matrix.  At worst, we have
to add a new possibility to one of the dimensions.



(Personally, I prefer PEP308[1,1,1])

-- 
CARL BANKS




More information about the Python-list mailing list