blob: dffcf430c643d28ee6251bc639d2d7c6cc27ecf8 [file] [log] [blame]
Fred Drake1abf0df1998-01-21 04:58:10 +00001\section{Standard Module \sectcode{copy_reg}}
2% 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
15\renewcommand{\indexsubitem}{(in module copy_reg)}
16
17\begin{funcdesc}{constructor}{object}
18 Declares \var{object} to be a valid constructor.
19\end{funcdesc}
20
21\begin{funcdesc}{pickle}{type, function\optional{, constructor}}
22 Declares that \var{function} should be used as a ``reduction''
23 function for objects of type or class \var{type}. \var{function}
24 should return either a string or a tuple. The optional
25 \var{constructor} parameter, if provided, is a callable object which
26 can be used to reconstruct the object when called with the tuple of
27 arguments returned by \var{function} at pickling time.
28\end{funcdesc}