深刻理解python对象及属性

类属性和实例属性 首先来看看类属性和类实例的属性在python中如何存储,经过__dir__方法来查看对象的属性python >>> class Test(object): pass >>> test = Test() # 查看类属性 >>> dir(Test) ['__class__','__delattr__','__dict__','__doc__','__format__'
相关文章
相关标签/搜索