Classes can use the same interfaces to control copying that they use to control
pickling. See the description of module :mod:`pickle` for information on these
-methods. The :mod:`copy` module does not use the :mod:`copy_reg` registration
+methods. The :mod:`copy` module does not use the :mod:`copyreg` registration
module.
.. index::
-
-:mod:`copy_reg` --- Register :mod:`pickle` support functions
-============================================================
+:mod:`copyreg` --- Register :mod:`pickle` support functions
+===========================================================
.. module:: copy_reg
+ :synopsis: Old name for the copyreg module.
+
+.. module:: copyreg
:synopsis: Register pickle support functions.
.. note::
- The :mod:`copy_reg` module has been renamed to `copyreg` in Python 3.0.
+ The :mod:`copy_reg` module has been renamed to :mod:`copyreg` in Python 3.0.
+ It is importable under both names in Python 2.6 and the rest of the 2.x
+ series.
.. index::
module: pickle
module: cPickle
module: copy
-The :mod:`copy_reg` module provides support for the :mod:`pickle` and
+The :mod:`copyreg` module provides support for the :mod:`pickle` and
:mod:`cPickle` modules. The :mod:`copy` module is likely to use this in the
future as well. It provides configuration information about object constructors
which are not classes. Such constructors may be factory functions or class
and calls :meth:`__reduce__`.
An alternative to implementing a :meth:`__reduce__` method on the object to be
-pickled, is to register the callable with the :mod:`copy_reg` module. This
+pickled, is to register the callable with the :mod:`copyreg` module. This
module provides a way for programs to register "reduction functions" and
constructors for user-defined types. Reduction functions have the same
semantics and interface as the :meth:`__reduce__` method described above, except
.. seealso::
- Module :mod:`copy_reg`
+ Module :mod:`copyreg`
Pickle interface constructor registration for extension types.
Module :mod:`shelve`