# Random Recursion in Perspective View

**URL:** <https://forum.inductiveautomation.com/t/random-recursion-in-perspective-view/91777>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [June 12, 2024, 7:49pm UTC](https://forum.inductiveautomation.com/t/random-recursion-in-perspective-view/91777 "2024-06-12T19:49:22Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 17, 2024, 6:13pm UTC](https://forum.inductiveautomation.com/t/random-recursion-in-perspective-view/91777/6 "2024-06-17T18:13:38Z")

</div>

You can use something like this to recursively unwrap our special 'wrapper' types into plain Python dictionaries/lists:

> [@Function to convert json string or python dict into ObjectWrapper](https://forum.inductiveautomation.com/t/function-to-convert-json-string-or-python-dict-into-objectwrapper/32861/16):
>
> Forcing each to the expected type while traversing makes a deep copy: def sanitize\_tree(element): if hasattr(element, '\_\_iter\_\_'): if hasattr(element, 'keys'): return dict((k, sanitize\_tree(element[k])) for k in element.keys()) else: return list(sanitize\_tree(x) for x in element) return element EDIT: Got rid of the unnecessary zip() and used only one keys() iterator instead of two.

---

_[View the full topic](https://forum.inductiveautomation.com/t/random-recursion-in-perspective-view/91777)._
