Relative Content

Tag Archive for pythonjson

Maintaining object copy/reference link after serialization into JSON and deserialization back to Python

I have set of fixed standardized Python objects I serialize into JSON, and then deserialize later. In some cases I have an object somewhere in the structure that I want to copy for practical access purposes (multiple user workflows). When I first create this in Python, editing the copy of the object also edits the original object – this is correct. However, when I serialize and deserialize the Python object loses the link between copy and original, and those two objects become completely unrelated, and each is edited separately.