I have really strange problem. Here is the sample code:
class SomeClass(object):
a = []
b = []
def __init__(self, *args, **kwargs):
self.a =
As many have already mentioned it, you end up having two references on the same list. Modifying the list by one reference of by the other just modify the list.
Here is an illustration to make things more clear if needed:
Step "A" is just after
self.a = [(1,2), (3,4)]
Step "A" is just after
self.b = self.a
Step "C" is just after
self.a.append((5,6))