The copy_reg module extends the capabilities of the pickle and cPickle modules to handle the serialization of objects described by extension types (as defined in C extension modules). To do this, extension writers use this module to register reduction and construction functions that are used to serialize and unserialize an object, respectively.
Declares cfunc to be a valid constructor function. cfunc must be a callable object that accepts the tuple of values returned by the reduction function given to the pickle() function.
pickle(type, rfunc [, cfunc])
Registers rfunc as a reduction function for objects of type type.rfunc is a function that takes an object of the specified type and returns a tuple containing the constructor ...