>>> class A:
... def __init__(self, edges=[]):
... self.edges = edges
>>> G = {'x': [A(), A()], 'y': [A(), A()]}
>>> G['y'][0].edges.append(7)
>>> G['y'][0].edges
[7]
>>> G['x'][0].edges
[7]
Why is it when appending to G['y'][0].edges
it also appends to all other lists. I found this similar problem but I can't tell if it is happening because of the same reason or not.