the list updated within a class
问题 class A(object): aalist = [] ai = 0 def __init__(self): self.ablist = list() def add(self): self.aalist.append(["a","a"]) self.ablist.append(["b","b"]) self.ai = self.ai + 1 class B(A): def __init__(self): A.__init__(self) self.bblist = list() def badd(self): self.bblist.append(['c','c']) for i in range(1,4): c = B() c.add() c.badd() print c.aalist,c.ablist,c.bblist,c.ai run these codes , the result prompts: [['a', 'a']] [['b', 'b']] [['c', 'c']] 1 [['a', 'a'], ['a', 'a']] [['b', 'b']] [['c',