def __setitem__(self, key, value):
    old_value = list.__getitem__(self, key)
for obj, key in list(self._parents.items()):
    old_value._parents.pop(obj, None)
list.__setitem__(self, key, value)
for obj, key in list(self._parents.items()):
    value._parents[obj] = key
self.changed()

def __getstate__(self):
    return list(self)

def __setstate__(self, state):
    self[:] = state
PickleType with Mutable Tracking in SqlAlchemy