python: pickling c objects
问题 First off I'm not expecting a solution, just hoping for some pointers on how to start. I've got a C program with an embedded Python interpreter. The Python scripts the program uses as input obviously refer to the C-defined objects and functions. I'd now like to make some of these objects pickleable. The pickle docs describe how extension types can be made picklable using __reduce__ . But this is a Python method - how would I define this in the underlying PyObject? Fairly sure I'm mis