[issue12233] Lists in class objects not independent

2011-05-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sorry, that is correct behavior for class variables. To get your intended effect (independent lists) do the list instantiation inside the __init__ method. -- nosy: +rhettinger resolution: -> invalid status: open -> closed

[issue12233] Lists in class objects not independent

2011-05-31 Thread Austin Howard
New submission from Austin Howard : 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 th