Skip to content Skip to sidebar Skip to footer

Pickling A Python Extension Type Defined As A C Struct Having PyObject* Members

I am running C++ code via Python and would like to pickle an extension type. So I have a C++ struct (py_db_manager) containing pointers to a database object and a object manager ob

Solution 1:

Because this will be passed to another process, pickling just integer pointers will not work as you would want it to. Different processes use different memory space therefore they don't see the same things.

So, to answer your question, you should pickle full objects and reconstruct them from the receiving end.


Post a Comment for "Pickling A Python Extension Type Defined As A C Struct Having PyObject* Members"