sending a function on the fly?

Emile van Sebille emile at fenx.com
Wed Nov 14 12:06:16 EST 2001


"Peter Bismuti" <peterb at cortland.com> wrote in message
news:3bf2a06f$1 at 207.229.64.20...
>
> In ECMAscript you can send a function as an argument that is defined on
the
> fly such as:
>
> callMyFunction( new Function(){ blah blah })
>
> Something like that. Here the function has not been named and was not
> defined outside of the call.   Can this be done in Python?
>

Simple one-line functions are created using lambda.  If it gets more
involved, try currying from class instances or functions.

--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list