© 2025 InterSystems Corporation, Cambridge, MA. All rights reserved.Privacy & TermsGuaranteeSection 508Contest Terms
Keep up with latest product news





















Serialization/deserialization for Python lists
USER>k ^test
USER>Do $system.Python.Shell()
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type quit() or Ctrl-D to exit this shell.
>>> from iris_global_serializer import IrisGlobalSerializer
>>> mylist = ["apple", "banana", "cherry"]
>>> mylist
['apple', 'banana', 'cherry']
>>> serializer = IrisGlobalSerializer(gname="^test")
>>> goref = serializer.serialize(mylist)
>>> goref
1
>>> quit()
USER>zw ^test
^test(1,"_class")="<class 'list'>"
^test(1,"idx0","type")="<class 'str'>"
^test(1,"idx0","value")="apple"
^test(1,"idx1","type")="<class 'str'>"
^test(1,"idx1","value")="banana"
^test(1,"idx2","type")="<class 'str'>"
^test(1,"idx2","value")="cherry"
^test("idx")=1
USER>Do $system.Python.Shell()
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type quit() or Ctrl-D to exit this shell.
>>> from iris_global_serializer import IrisGlobalSerializer
>>> goref = 1
>>> serializer = IrisGlobalSerializer(gname="^test")
>>> deserializedObj = serializer.deserialize(goref)
>>> deserializedObj
['apple', 'banana', 'cherry']
>>> quit()