# coding: utf-8
class AAA():
aaa = 10
obj1 = AAA()
obj2 = AAA()
print obj1.aaa, obj2.aaa, AAA.aaa
print obj1.__dict__, obj2.__dict__, AAA.__dict__
obj1.aaa += 2
print obj1.aaa, obj2.aaa, AAA.aaa
print obj1.__dict__, obj2.__dict__, AAA.__dict__
AAA.aaa += 3
print obj1.aaa, obj2.aaa, AAA.aaa
print obj1.__dict__, obj2.__dict__, AAA.__dict__
转自:http://bluecrystal.iteye.com/blog/234923
python中类型关系和继承关系:http://www.builder.com.cn/2008/0521/875093.shtml