[Python-Dev] Adding a conditional expression in Py3.0 (original) (raw)

Terry Reedy tjreedy at udel.edu
Sat Sep 24 07:57:47 CEST 2005


"Nick Coghlan" <ncoghlan at gmail.com> wrote in message news:4334DD43.1010207 at gmail.com...

I am reminded of how some people seem to react to fingernails on a blackboard, while the screech is just another noise to me, except that I am in the opposite position with respect to a if b else c.

Does it help if you think of "if else" as a parameterised infix operation for choosing between the expressions on either side?

Hmm. If I parse it as a (if b else) c and sort of ignore the words and think of it as so that the whole thing is a switch pointing either left or right? A bit strange, but perhaps it does.

Terry J. Reedy



More information about the Python-Dev mailing list