I don't understand what is going on here. I have a class "C" that is a subclass of "B". "B" has an attribute "b" which is an instance of class "A". "A" has one attribute, a list called "a". When I initialize two different instances of "C", they have the same instance of "A" such that when I append to A.a it results in both instances of "C" having an appended attribute "b.a".
class A:
a = list()
class B:
b = A()
class C(B):
pass
one = C()
two = C()
one.b.a.append('one')
one.b.a.append('two')
two.b.a.append('three')
print(one.b.a)
print(two.b.a)
Running this code prints out:
['one', 'two', 'three']
['one', 'two', 'three']
Clearly, one.b.a and two.b.a are pointing to the same object when I would have expected a new instance of "A" to be initialized whenever I call C(). Why is this happening and how do I fix it?