map/filter/reduce/lambda opinions and background unscientificmini-survey

Ron Adam rrr at ronadam.com
Wed Jul 6 00:54:00 EDT 2005


Terry Reedy wrote:

> I also suspect that the years of fuss over Python's lambda being what it is 
> rather that what it is 'supposed' to be (and is in other languages) but is 
> not, has encourage Guido to consider just getting rid of it.  I personally 
> might prefer keeping the feature but using a different keyword.
> 
> Terry J. Reedy

Yes, I think a different key word would help.  My current favorite 
alternative is to put it in parentheses similar to list comprehensions 
and use "let".

(let x,y return x+y)

Or you could just explain lambda as let, they both begin with 'L',  and 
then the colon should be read as return.

So lambda x,y: x+y should be read as:  let x,y return x+y

I'm in the group that hadn't heard about lambda as a function before 
Python even after > twenty years of computer tech experience.  I think 
presuming it's common knowledge is a mistake.

Cheers, Ron




More information about the Python-list mailing list