Lambda going out of fashion
claird at lairds.us
Tue Dec 28 19:08:10 CET 2004
In article <1gp9nrb.807eedbgd0shN%aleaxit at yahoo.com>,
Alex Martelli <aleaxit at yahoo.com> wrote:
><tanghaibao at gmail.com> wrote:
>> Thanks. :-) Two remarks.
>> o One-liner fits the eyes & brains of a portion of people.
>True! So, personally, I'd rather code, e.g.,
>def bools(lst): return map(bool, lst)
>rather than breal this one-liner into two lines at the colon, as per
>standard Python style. However, uniformity has its advantages, too; I'm
>ready for the one-liner style to be outlawed in Python 3.0, purely in
>the advantage of uniformity.
>Note that lambda is utterly useless here, be it for one-liners or not.
Please say that last sentence another way. I *think* you mean
that to define (def) a non-pathologic named function, lambda
provides no advantage; one sacrifices no expressivity by a
restriction to def-s. Is that right?
More information about the Python-list