2015-01-13, 14:24
for pickling:
http://paste.ubuntu.com/9728931/
shows the basics of how to make a C python class pickle-able. as this is from internal code i cannot currently distribute, i have had to strip it somewhat. the important stuff:
1) have __reduce__ in the class. this needs to use Py_BuildValue as done there.
2) have a constructor for the class, which can reconstruct the object based on the serialized info in __reduce__ (same order of arguments is important).
http://paste.ubuntu.com/9728931/
shows the basics of how to make a C python class pickle-able. as this is from internal code i cannot currently distribute, i have had to strip it somewhat. the important stuff:
1) have __reduce__ in the class. this needs to use Py_BuildValue as done there.
2) have a constructor for the class, which can reconstruct the object based on the serialized info in __reduce__ (same order of arguments is important).