Conditional Expressions

September 9, 2006

Finally! Python will support conditional expressions with its 2.5 release (which is available now as a release candidate). Here’s an example of the new, funky syntax:

x = true_value if condition else false_value

Oh, and I’m also excited about the “Unified try/except/finally” (PEP 341) and “Exceptions as New-Style Classes” (PEP 352).