[Python-checkins] r63154 - in python/trunk/Doc/library: copy.rst copy_reg.rst copyreg.rst persistence.rst pickle.rst
georg.brandl
python-checkins at python.org
Mon May 12 12:05:40 CEST 2008
Author: georg.brandl
Date: Mon May 12 12:05:39 2008
New Revision: 63154
Log:
Fix-up docs for the copyreg module renaming.
Added:
python/trunk/Doc/library/copyreg.rst (contents, props changed)
- copied, changed from r63151, /python/trunk/Doc/library/copy_reg.rst
Removed:
python/trunk/Doc/library/copy_reg.rst
Modified:
python/trunk/Doc/library/copy.rst
python/trunk/Doc/library/persistence.rst
python/trunk/Doc/library/pickle.rst
Modified: python/trunk/Doc/library/copy.rst
==============================================================================
--- python/trunk/Doc/library/copy.rst (original)
+++ python/trunk/Doc/library/copy.rst Mon May 12 12:05:39 2008
@@ -63,7 +63,7 @@
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::
Deleted: python/trunk/Doc/library/copy_reg.rst
==============================================================================
--- python/trunk/Doc/library/copy_reg.rst Mon May 12 12:05:39 2008
+++ (empty file)
@@ -1,44 +0,0 @@
-
-:mod:`copy_reg` --- Register :mod:`pickle` support functions
-============================================================
-
-.. module:: copy_reg
- :synopsis: Register pickle support functions.
-
-.. note::
- The :mod:`copy_reg` module has been renamed to `copyreg` in Python 3.0.
-
-.. index::
- module: pickle
- module: cPickle
- module: copy
-
-The :mod:`copy_reg` 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
-instances.
-
-
-.. function:: constructor(object)
-
- Declares *object* to be a valid constructor. If *object* is not callable (and
- hence not valid as a constructor), raises :exc:`TypeError`.
-
-
-.. function:: pickle(type, function[, constructor])
-
- Declares that *function* should be used as a "reduction" function for objects of
- type *type*; *type* must not be a "classic" class object. (Classic classes are
- handled differently; see the documentation for the :mod:`pickle` module for
- details.) *function* should return either a string or a tuple containing two or
- three elements.
-
- The optional *constructor* parameter, if provided, is a callable object which
- can be used to reconstruct the object when called with the tuple of arguments
- returned by *function* at pickling time. :exc:`TypeError` will be raised if
- *object* is a class or *constructor* is not callable.
-
- See the :mod:`pickle` module for more details on the interface expected of
- *function* and *constructor*.
-
Copied: python/trunk/Doc/library/copyreg.rst (from r63151, /python/trunk/Doc/library/copy_reg.rst)
==============================================================================
--- /python/trunk/Doc/library/copy_reg.rst (original)
+++ python/trunk/Doc/library/copyreg.rst Mon May 12 12:05:39 2008
@@ -1,19 +1,23 @@
-
-: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
Modified: python/trunk/Doc/library/persistence.rst
==============================================================================
--- python/trunk/Doc/library/persistence.rst (original)
+++ python/trunk/Doc/library/persistence.rst Mon May 12 12:05:39 2008
@@ -19,7 +19,7 @@
.. toctree::
pickle.rst
- copy_reg.rst
+ copyreg.rst
shelve.rst
marshal.rst
anydbm.rst
Modified: python/trunk/Doc/library/pickle.rst
==============================================================================
--- python/trunk/Doc/library/pickle.rst (original)
+++ python/trunk/Doc/library/pickle.rst Mon May 12 12:05:39 2008
@@ -535,7 +535,7 @@
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
@@ -786,7 +786,7 @@
.. seealso::
- Module :mod:`copy_reg`
+ Module :mod:`copyreg`
Pickle interface constructor registration for extension types.
Module :mod:`shelve`
More information about the Python-checkins
mailing list