This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author austin1howard
Recipients austin1howard
Date 2011-06-01.01:39:52
SpamBayes Score 0.0001229069
Marked as misclassified No
Message-id <1306892393.27.0.721356313159.issue12233@psf.upfronthosting.co.za>
In-reply-to
Content
When creating a class which contains elements that are lists, the lists for different instances of the class are not independent. Calling
self.mylist.append(3)
inside a class method will update the mylist variable for *all* instances of the class, not just the current instance. Attached is a script which demonstrates this behavior.
History
Date User Action Args
2011-06-01 01:39:53austin1howardsetrecipients: + austin1howard
2011-06-01 01:39:53austin1howardsetmessageid: <1306892393.27.0.721356313159.issue12233@psf.upfronthosting.co.za>
2011-06-01 01:39:52austin1howardlinkissue12233 messages
2011-06-01 01:39:52austin1howardcreate