lambda ??

Jan Gregor gregor.jan at
Fri Aug 27 11:09:59 CEST 2004

Python is little bit limited in lambda functions. In lisp I use lambda
functions in functionals (something like a map or reduce in python)
as a wrapper for functions with more than one argument.


On 2004-08-27, Michael Foord <fuzzyman at> wrote:
> I'm starting to read through the developer works article on Functional
> Programming -
> It starts by giving some basic examples using lambda. What I'm
> wondering is what's the actual difference between these two forms ?
> pr = lambda s:s
> *and*
> def pr(s):
>     return s
> Both bind the name 'pr' to a function object that does the same thing
> ?? I know that lambda functions can only be a single expression......
> Is it just a basic example (and so in this case there is no
> difference).. or am I missing something. (What's the point of an
> 'anonymous' function... if you give a name to it !!).
> Regards,
> Fuzzy

More information about the Python-list mailing list