I have a data structure which consists of lists, ints and strings, nested arbitarily. For example:
[ "data", [ 1, "file", [], [1,2] ], 3 ]
I want to index a dict
using objects like this, but I can't because python complains they are not immutable (which is true). I am suprised to find that there doesn't seem to be a generic recursive 'make immutable' function. Does such a function exist? Is there a good reason why not? And how should I work around this problem?