In [54]: class Person():
....: name = 'yanxiaori'
....:
In [55]: p1 = Person()
In [56]: p2 = Person()
In [57]: print p1.name
yanxiaori
In [58]: p1.name = 'yandari'
In [59]: print p2.name
yanxiaori
In [60]: print Person.name
yanxiaori
In [61]:
实例属性访问时,先搜索实例命名空间内,没有的话就搜索类中的,不行就继续搜索继承树种的基类