[Python-Dev] 308: the debate is petering out

Raymond Hettinger python@rcn.com
Tue, 18 Feb 2003 20:40:32 -0500


> Raymond, have any new proposals been suggested and not shot down?

Someone re-proposed c ? a else b.  Their rationale is that the ? is a better
marker than "then" and is suggestive enough to not need a leading "if";
it doesn't require a new keyword and does not overload the colon.
No one shot this down but it didn't generate any real support either.

There was an interesting, weird, and fruitless discussion on how
"c then a else b" could be implemented as a pair of binary operators
that are not required to be used together.

There was a rapidly shot down idea to use bool.choose(a, b) where
choose() was a special method that could somehow implement
lazy evaluation of its arguments.

A recent proposal is: (? <cond1>: <expr1>, <cond2>: <expr2>, <default> ?).
There have only been a few hours for comment.  Though the visual
cues are there, my issue with it is that the colon usage is likely to confuse
anyone exposed to the c?a:b form in other languages where the colon
separates the alteratives rather than the condition and alternative.


Raymond Hettinger