better lambda support in the future?

Steven Bethard steven.bethard at gmail.com
Fri Dec 17 17:04:03 EST 2004


Jason Zheng wrote:
> The true beauty of lambda function is not the convenience of creating 
> functions without naming them. Lambda constructs truly enables 
> higher-order function. For example, I can create a function A that 
> returns a function B that does something interesting according to the 
> arguments that I pass to function A.

Like this?

def A(*args, **kwds):
     def B():
         print args, kwds
     return B

But you don't need lambdas to do this.  In fact, even in your email, 
you'll note that you referred to your two functions by name.  If you're 
naming functions, why not use a def statement?

Steve



More information about the Python-list mailing list