There's also discussion of this on Scripted objects saving attributes.
Furthermore, there's discussion of overriding the __getstate__ and __setstate__ methods. However, my understanding is that these methods only apply when using pickle.
See pickle module reference:
https://docs.python.org/3/library/pickl ... __getstate__
There's no mention of __getstate__ and __setstate__ methods in the json module docs:
Also, this StackOverflow comment says:
My questions:pickle supports state hooks (__getstate__ and companions), but json does not support any such helpful methods.
1. As of FreeCAD 19, do we use json, pickle, or both for serialization / deserialization of scripted objects?
2. If we only use json, then is overriding the __getstate__ and __setstate__ methods necessary?