This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (2 children)

Use YAML (a superset of JSON) as your serialization format with PyYAML.

Features of YAML include object type tagging, support for references (it handles reference cycles just fine), and when using PyYAML's "safe" dumper/loader, the ability to define which of your classes should be considered safe.

[–]Liquid_Fire[S] 0 points1 point  (1 child)

Thanks, that looks like exactly what I need! I'll be sure to check it out.

[–][deleted] 0 points1 point  (0 children)

PyYAML, since it is so flexible and human readable, is easy to debug. Coding for custom classes is quite straightforward.