Ternary Operator Now?

Xavier Morel xavier.morel at masklinn.net
Wed Feb 8 18:35:52 EST 2006


Ben Wilson wrote:
> 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
> 
PEP 308 "Conditional Expressions" has been accepted for Python 2.5, I'm 
pretty sure implementation hasn't even started yet.



More information about the Python-list mailing list