# Hoe to convert perspective object property to org.python.core.PyDictionary

**URL:** <https://forum.inductiveautomation.com/t/hoe-to-convert-perspective-object-property-to-org-python-core-pydictionary/71943>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 2, 2023, 7:08am UTC](https://forum.inductiveautomation.com/t/hoe-to-convert-perspective-object-property-to-org-python-core-pydictionary/71943 "2023-04-02T07:08:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [April 2, 2023, 7:08am UTC](https://forum.inductiveautomation.com/t/hoe-to-convert-perspective-object-property-to-org-python-core-pydictionary/71943/1 "2023-04-02T07:08:37Z")

</div>

Hello

When I try to reference a perspective object property in my script the Ignition converts them to `class com.inductiveautomation.perspective.gateway.script.DotReferenceJythonMap` which is good for most cases.  
But I want to convert them to class org.python.core.PyDictionary so I can use the python .copy() function or similar things on it.  
So the first question is how to make a deep copy of DotReferenceJythonMap?  
And how to convert `class com.inductiveautomation.perspective.gateway.script.DotReferenceJythonMap` to python dictionary?

---

<div class="post-metadata">

**Author:** ![Matthew.gaitan](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthew.gaitan](https://forum.inductiveautomation.com/u/Matthew.gaitan)\
**Post date:** [April 3, 2023, 4:49pm UTC](https://forum.inductiveautomation.com/t/hoe-to-convert-perspective-object-property-to-org-python-core-pydictionary/71943/2 "2023-04-03T16:49:29Z")

</div>

I **really** wish ignition would do this for you automatically.

I have resorted to using this function on any list / dictionary type object before use because without it I inevitably run into issues trying to treat them like a list / dictionary.

> [@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.
