I do the following:
class Test:
def __init__(self, a, b, c=[]):
self.a = a
self.b = b
self.c = c
t1 = Test(1,2)
t2 = Test(3,4)
t1.c.append(5)
t2.c
Out: [5]
t1 == t2
Out: False
t1.c == t2.c
Out: True
Why is changing property c of instance t1 also changing the property c of instance t2? What can I do to avoid this behaviour?
Thank You for your answers