我想传递类似于成员函数指针的东西。我尝试了以下。
class dummy:
def func1(self,name):
print 'hello %s' % name
def func2(self,name):
print 'hi %s' % name
def greet(f,name):
d = getSomeDummy()
d.f(name)
greet(dummy.func1,'Bala')
预期输出为hello Bala