[Baypiggies] lambda for newbies -- newbie clarification

Laurence Clark hsuclarklarry at sbcglobal.net
Wed May 16 06:21:40 CEST 2007

Shannon -jj Behrens wrote:

> I think Guido made a conscious decision to say, "Hey, if you're going to make a non-trivial function, giving it a name makes it a lot more readable.
Pardon me, I enjoy learning many different languages and using them as 
appropriate. The pitfall is occasional moments of confusion as they all 
run together.

I guess I was looking for a way to cheat on Guido's decision -- thinking 
there must be some way to create anonymous functions WITHOUT lambda. It 
appears, on rereading the Python Tutorial that lambda is the only way. 
If I want a function with more than one statement, I must give it a 
name. I write a lot of little throw away scripts where readability is 
just not important. This reinforces my thinking that Python is 
appropriate for slightly larger programs rather than one-liners.

More information about the Baypiggies mailing list