Fred Drake | 3a0351c | 1998-04-04 07:23:21 +0000 | [diff] [blame] | 1 | \section{Standard Module \module{copy_reg}} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame^] | 2 | \declaremodule[copyreg]{standard}{copy_reg} |
Fred Drake | 1abf0df | 1998-01-21 04:58:10 +0000 | [diff] [blame] | 3 | |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame^] | 4 | \modulesynopsis{Register \module{pickle} support functions.} |
| 5 | |
| 6 | |
| 7 | The \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 Drake | 1abf0df | 1998-01-21 04:58:10 +0000 | [diff] [blame] | 11 | future as well. It provides configuration information about object |
| 12 | constructors which are not classes. Such constructors may be factory |
| 13 | functions or class instances. |
| 14 | |
Fred Drake | 1abf0df | 1998-01-21 04:58:10 +0000 | [diff] [blame] | 15 | |
| 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} |