Message137410
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. |
|
Date |
User |
Action |
Args |
2011-06-01 01:39:53 | austin1howard | set | recipients:
+ austin1howard |
2011-06-01 01:39:53 | austin1howard | set | messageid: <1306892393.27.0.721356313159.issue12233@psf.upfronthosting.co.za> |
2011-06-01 01:39:52 | austin1howard | link | issue12233 messages |
2011-06-01 01:39:52 | austin1howard | create | |
|