New submission from Matthew <matthew.bayn...@gmail.com>: What I intended was... I create a list of DIFFERENT instances of the same class, I wanted them to be different instances, with different values for the properties, stressing the word "DIFFERENT".
What I originally did was... The __init__ assigns default values for the properties (eg, iId = 0, and sName = ''), then I would change to properties before adding it to the list. However, the list will contain the right number of elements, but every element is the same instance of the class. I resolved this by... If I change __init__ such that I'm passing it parameters with values to assign to the properties. And then adding the instances of the class to the list. Then each element in the list is a different instance. And this made everything work. ---------- components: Windows messages: 88340 nosy: mbaynham severity: normal status: open title: Dupicate instances of classes in list versions: Python 2.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6113> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com