how to call back a method in python3?

水静流深 1248283536 at qq.com
Sun Aug 3 21:56:09 EDT 2014


I want to call back a function which is the method of a class .

    def callback(self.do,x):
        return(self.do(x))

That is what i want to write,when i input 
     
    def callback(self.do,x):

error message:


      File "<stdin>", line 1
        def callback(self.do,x):
                     ^
    SyntaxError: invalid syntax


`do` is a method in my class ,how to write the code?‍
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20140804/fc85e7e8/attachment.html>


More information about the Python-list mailing list