lambda versus "mlambda"...

Dave Abrahams abrahams at mediaone.net
Thu May 11 05:58:09 CEST 2000


in article 391A301B.D59F070F at san.rr.com, Courageous at jkraska1 at san.rr.com
wrote on 5/10/00 11:55 PM:

> However, one of the things that I think would be nice are lambda
> *methods*. That is, if you pass a lambda function off using
> "mlambda" (a builting I just made up), and this lambda function
> is generated in the context of a class or an instance, it would
> behave like a method object callable, automatically encapsulating
> the method (to wit: upon invocation, the passing of "self" is
> assumed).

I think what you want is spelled thusly:

    lambda <args>, self=self: <expression>

Cheers,
Dave




More information about the Python-list mailing list