Since there was talk of if-then-else not being allowed in lambda expressions, the following is from "Dive into Python"

Ant antroy at gmail.com
Fri Jul 21 06:04:39 EDT 2006


> # python 2.5
> >>> a, b = "", 0
> >>> a if False else b
> 0
> >>> a if True else b
> ''
>
> Time to tear out that page. Really.

Not quite - 2.5 hasn't been released in its final version yet, and many
projects I should imagine will take a while to upgrade.




More information about the Python-list mailing list