from traits.api import HasTraits, Dict, Str, Tuple, List
from apptools.persistence import state_pickler as sp
class Model(HasTraits):
dict_item = Dict()
tuple_item = Tuple()
str_item = Str()
list_item = List()
def main():
inner = Model(
dict_item=dict(a=1),
tuple_item=(1, 2, 3),
str_item="bla",
list_item=[4, 5, 6]
)
outer = Model(
dict_item=dict(a=inner),
tuple_item=(inner, inner),
str_item="blubb",
list_item=[inner, inner]
)
state = sp.get_state(outer)
if __name__ == '__main__':
main()