class Test(object): def __init__(self,a): self.a = a def func1(self): #调用回调函数 return self.func2(self.a,self.calls) def func2(self,aa,func): #执行回调函数 return func(aa) def calls(self,ss): #被回调函数 self.ss = ss+8 return self.ss test = Test(8) print(test.func1())