Ternary Operator Now?

Ben Wilson dausha at gmail.com
Wed Feb 8 18:01:34 EST 2006


I read somewhere else that Python was getting a ternary operator (e.g.
x = (true/false) ? y : z). I read the PEP about it and that the PEP had
been approved this past Fall. Has this been released into the wild yet?

IIRC, the operator is like:

x = y if C : else z




More information about the Python-list mailing list