Theoretical question about Lambda
Alex Martelli
aleax at aleax.it
Thu May 2 15:25:29 EDT 2002
Terry Reedy wrote:
...
>> smiley fraction here), if/else is much more comfortable for this
>
> This is a matter of taste, not objectivity. Given that bool(function)
...
> foo = doitoneway and (lambda: whatever) or (lambda: somethingelse)
>
> It saves screen/page lines and to me is easier to grasp.
Obviously, the "This is a matter of taste" definitely applies wrt this
"easier to grasp". There remains the objective fact, to answer the OP,
that there is really nothing important that lambda buys you, including this
further obfuscation (in my view) of double and/or short-circuiting.
Alex
More information about the Python-list
mailing list