PEP-308 left to right, c ? a else b

Erik Max Francis max at alcyone.com
Mon Feb 17 14:23:35 EST 2003


Marco Mariani wrote:

> oops, it's "c ? a else b" or i'll get a thousand replies telling me I
> don't really get it, just like Tim Peters proposing to ban "and" &
> "or"
> from python :-)

If c is the condition expression and a and b are the expressions to
evaluate if it's true or false, respectively, then what you're proposing
is

	C ? x else y

which was proposed as an alternate to the ?: notation very early on in
the threads.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ No one knows what he can do until he tries.
\__/ Publilius Syrus
    Maths reference / http://www.alcyone.com/max/reference/maths/
 A mathematics reference.




More information about the Python-list mailing list