python类内部调用自己的成员函数必须加self

class A:
    def a(self):
        print("hello world")
    
    def b(self):
        return self.a()

 

posted @ 2020-10-21 13:04  胸怀丶若谷  阅读(2401)  评论(0)    收藏  举报