Loic Mahe <[EMAIL PROTECTED]> writes:

> Chris M write :
>> Multi-return value lambda? Just so you know, there is no concept of
>> returning more than one value from a function.
>
> I wrote:
>> * multi return value lambda
>
> I meant: multiple return statement, not return multiple values
>
> pseudo code here:
>
> lambda x: if A return B, if C return D, if E return F ...

You can do that with conditional expressions:

lambda x: B if A else D if C else F in E ...

> it could be nice if ou could write normal functions ... as lambda
> ones and not being limited to a subset of the kewords ...

It becomes natural if you think of lambda as a deferred expression
rather than as an anonymous function.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to