anonymous functions? class?

Peoter Veliki peoter_veliki at hotmail.com
Thu Nov 15 23:08:11 CET 2001


I'd like to be able to use a function as an argument without declaring it externally.  
This is what I don't want to do:

def func():
    pass
callFunc(func)

I want to do this:

callFunc(def func():pass)

I'm guessing this can't be done because of python's indentation syntax.  In ECMAscript (JavaScript) you can do this:

callFunc( new func(){ blah blah } ) 

or something like that. 


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20011115/3ffd3d33/attachment.html>


More information about the Python-list mailing list