Proposed PEP for a Conditional Expression

James_Althoff at James_Althoff at
Wed Sep 19 20:29:15 CEST 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.


More information about the Python-list mailing list