blob: 0874b4ecdc9c8bfa83d8c9aac649becbbdd2516c [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Standard Module \module{copy_reg}}
Fred Drakeb91e9341998-07-23 17:59:49 +00002\declaremodule[copyreg]{standard}{copy_reg}
Fred Drake1abf0df1998-01-21 04:58:10 +00003
Fred Drakeb91e9341998-07-23 17:59:49 +00004\modulesynopsis{Register \module{pickle} support functions.}
5
6
7The \module{copy_reg} module provides support for the
8\module{pickle}\refstmodindex{pickle} and
9\module{cPickle}\refbimodindex{cPickle} modules. The
10\module{copy}\refstmodindex{copy} module is likely to use this in the
Fred Drake1abf0df1998-01-21 04:58:10 +000011future as well. It provides configuration information about object
12constructors which are not classes. Such constructors may be factory
13functions or class instances.
14
Fred Drake1abf0df1998-01-21 04:58:10 +000015
16\begin{funcdesc}{constructor}{object}
17 Declares \var{object} to be a valid constructor.
18\end{funcdesc}
19
20\begin{funcdesc}{pickle}{type, function\optional{, constructor}}
21 Declares that \var{function} should be used as a ``reduction''
22 function for objects of type or class \var{type}. \var{function}
23 should return either a string or a tuple. The optional
24 \var{constructor} parameter, if provided, is a callable object which
25 can be used to reconstruct the object when called with the tuple of
26 arguments returned by \var{function} at pickling time.
27\end{funcdesc}