PEP 308: Alternative conditional operator forms

Paul Rubin phr-n2003b at
Mon Feb 10 01:57:47 CET 2003

Erik Max Francis <max at> writes:
> Here is the list I have so far (C represents the conditional expression,
> x the if-true expression, y the if-false one):
> x if C else y # initial proposition in PEP
> C ? x ! y # mentioned in PEP
> (if C then x else y) # mentioned in PEP
> x when C else y
> (if C: x else: y)
> C ? x else y
> C -> x else y
> C -> (x, y)
> What else should be on this list?  (You can reply by email if you wish.)

cond(C, :x, :y)  and some variants on this which I don't remember exactly

Numerous other deferred evaluation schemes

A few macro schemes from threads gone by

More information about the Python-list mailing list