Pysistence - just checked if something like this exists or if I should write it myself. Pysistence implements functional persistent data structures for Python. This means that there are no side effects, but rather that each function provides a new version of the data, with common substructures shared across different versions (in order to be able to work efficiently with them both in terms of runtime and space requirements). I definitely need to take a look at this, as in many cases the lack of proper implementations of functional data structures in Python has bothered me.