小伙看你根骨奇佳,潜力无限,来学PHP伐。
I don’t understand your needs. Since it is a class member variable, it needs to be bound to an instance? Class variables are shared by all instances, instance variables only belong to the instance
class T: def __init__(self): self.d = {} if __name__ == "__main__": t1 = T() t2 = T() t1.d["a"] = 1 t2.d["b"] = 2 print t1.d print t2.d
I don’t understand your needs. Since it is a class member variable, it needs to be bound to an instance?
Class variables are shared by all instances, instance variables only belong to the instance