O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

copy_reg

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.

constructor(cfunc)

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required