Proposed PEP for a Conditional Expression

James_Althoff at i2.com James_Althoff at i2.com
Wed Sep 19 14:29:15 EDT 2001


Tom Payne wrote:
>I have a similar objection to the syntax:
>
>        cond( <exp1>, lambda:<exp2>, lambda:<exp3> )
>
>Moreover it doesn't scale up to multiple tests very well:
>
> cond( <exp>, lambda:<exp>, lambda:cond( <exp>, lambda:<exp>, lambda:<exp>
) )
>
>or stacked/indented version thereof.

... which is perhaps mitigated by the fact that nested conditional
expressions is probably not a great idea for readability in any case.

Jim




More information about the Python-list mailing list