类中的函数定义应包含“self”作为参数
class MyClass:
def first(self,a, b):
return a + b
def second(self,a, b):
return a * b
a = 2
b = 3
first_func = MyClass.first
second_func = MyClass.second
my_obj = MyClass()
first_func(my_obj,a, b) + second_func(my_obj,a, b) == 11