I am having trouble making copies to an object in python to translate over to another object. For example:
a = props.plots[index].trends
props.plots[index+1].trends = a
This completely wrecks the json structure, giving me a value type of “PropertyTreeScriptWrapper$MapWrapper” whose full path is “com.inductiveautomation.perspective.gateway.script.PropertyTreeScriptWrapper$MapWrapper”. Normally this is not an issue, I know I can treat this as a dictionary.
However, this particular json is nested with other json/dicts/lists in it. I can recursively go through it and make a copy to get rid of the object, but that’s terrible and I do reach the recursion depth limit sometimes. It’s not slow by any means, but that could change at high number of items. It’s presence is halting development.
I’d rather not use recursion, so how can we completely cast that object as a dict wherever it appears, or is there an alternative to copying that entire json over (aside from copying it piece by piece by knowing what the structure should look like for each json occurence). I’d also rather not copy each json piece by piece in order to move it to another json, but if we have to we have to.