blob: 7dabf42f81055dfd5e595cf6004d9389934e28f1 [file] [log] [blame]
Fred Drake3a0351c1998-04-04 07:23:21 +00001\section{Standard Module \module{copy_reg}}
Fred Drake1abf0df1998-01-21 04:58:10 +00002% Note that the label is a little off; the underscore causes LaTeX to
3% yell & scream.
4\label{module-copyreg}
5\stmodindex{copy_reg}
6
7The \code{copy_reg} module provides support for the
8\code{pickle}\refstmodindex{pickle} and
9\code{cPickle}\refbimodindex{cPickle} modules. The
10\code{copy}\refstmodindex{copy} module is likely to use this in the
11future 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}