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? Thanks