class Test: def __init__(self, x=[]): self.x = x a = Test() b = Test() a.x.append(1) print(a == b) # False # Suprised... Why would this be equal? print(a.x == b.x) # True class Test_Isolation: def __init__(self, x=None): if x is None: self.x = [] else: self.x = x a = Test_Isolation() b = Test_Isolation() a.x.append(1) # Expected print(a.x == b.x) # False