每次调用内部的方法时,方法前面加 self.
举例:
例子参考百度知道里面的回答
class MyClass:
def __init__(self):
pass
def func1(self):
# do something
print('a') #for example
self.common_func()
def func2(self):
# do something
self.common_func()
def common_func(self):
pass