class Person(object):
__count = 0
def __init__(self, name):
self.name = name
Person.__count += 1
print Person.__count
p1 = Person('Bob')
p2 = Person('Alice')
try:
print Person.__count
except AttributeError:
print 'attributeerror'
为什么最后会抛出attributeerror,求大神指点,谢谢
孤独的小猪
super_mb
相关分类