Python中的类中__dict__方法
类的静态函数,类函数,普通函数,全局变量以及内置属性都放在类__dict__中,对象的__dict__中存储了self.xx的东西
class A(object): a = 0 b = 1 def __init__(self): self.a = 2 self.b = 3 def test(self): print('a normal func.') @staticmethod def static_test(self): print('a static func.') @classmethod def class_test(self): print('a calss func.') obj = A() print(A.__dict__) print(obj.__dict__)