PEP308: Yet another syntax proposal
Raymond Hettinger
vze4rx4y at verizon.net
Mon Feb 10 13:00:53 EST 2003
"Sheila King" <usenet at thinkspot.net> wrote in message
news:b27qm7.v8.1 at kserver.org...
> > * The ?? and || strongly suggest testing and alternation.
>
> To whom? The || would only suggest alternation to those who have already
> programmed in languages where this is the symbol for "or".
In python, | is the symbol for bitwise-or.
When paired with ?? with || the meaning is further clarified.
> "Why do people keep proposing cryptic punctuation-based syntax for this?
Because:
1. New keyword proposals are doomed
2. Bending old keywords creates ambiguity
3. Punctuation operators work well in expressions.
Who (except a COBOL programmer) would want:
2 plus 3 times 5
4. Reading through the provided live code examples,
it is much clearer than keyword alternatives
5. I spent an afternoon finding the least cryptic
form of punctuation I could think of.
The only close alternative was:
x = cond ?? val1 :: val2
I felt || was better because colons were
already so heavily loaded.
Raymond Hettinger
More information about the Python-list
mailing list