I'm trying to create an object named "TestA", which will have a list of "TestB" objects. When I create two "TestA" objects and push different "TestB" objects to their lists, they end up having the same value.
class testA:
testBlist = []
def __init__(self, n) -> None:
self.name = n
pass
class testB:
def __init__(self, n) -> None:
self.name = n
pass
a = testA("test1")
b = testA("test2")
a.testBlist.append(testB("testB1"))
b.testBlist.append(testB("testB2"))
print(a.testBlist == b.testBlist )
#result is True