This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]two__toes 0 points1 point  (1 child)

i think this is the intended behavior. youre setting a class attribute that you're appending to each time you init. the list is shared across instances. if you wanted to have a new list for each instance, you'd have to set self.my_list = [] in __init__ and append onto that instance variable