> > Apparently, the p1 instance somehow thinks that the i3 instance is in > its list. The i3 instance should instead be in the list for p2. By the > way, when I call the __str__() method of p2, I get the same results as > when I do it for p1. The list appears to be acting as if it were a > static member - which it is not. > > I do have some @classmethod methods in these classes in my complete > script. Would that confuse the interpreter into thinking that other > members are also static? > > I can't seem to find any information on this problem. Does anyone have > any ideas?
Read this: http://www.python.org/doc/faq/general/#why-are-default-values-shared-between-objects HTH, Diez -- http://mail.python.org/mailman/listinfo/python-list