sending a function on the fly?

Paul Winkler slinkp23 at
Thu Nov 15 18:54:40 CET 2001

On Thu, 15 Nov 2001 11:08:50 +0100, Max M <maxm at> wrote:
>"Peter Bismuti" <peterb at> wrote in message
>news:3bf2a06f$1 at
>> In ECMAscript you can send a function as an argument that is defined on
>> 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?

You can't put a def statement inside a function call. But you could
use lambda.


More information about the Python-list mailing list