summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-02-23 16:39:43 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2008-02-23 16:39:43 (GMT)
commit8887e548674d34da0a9e025e68a1f55ff57a8752 (patch)
treefd3b882950cb7b5e0b83272e79c66a259e0d82f7 /Doc
parent085f75a8510000b38da641d5183a8a701c69d6d6 (diff)
downloadcpython-8887e548674d34da0a9e025e68a1f55ff57a8752.zip
cpython-8887e548674d34da0a9e025e68a1f55ff57a8752.tar.gz
cpython-8887e548674d34da0a9e025e68a1f55ff57a8752.tar.bz2
#835521: Add index entries for various pickle-protocol methods and attributes
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/pickle.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst
index 218e467..918fb8e 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -463,6 +463,11 @@ can do what they want. [#]_
Pickling and unpickling extension types
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. index::
+ single: __reduce__() (pickle protocol)
+ single: __reduce_ex__() (pickle protocol)
+ single: __safe_for_unpickling__ (pickle protocol)
+
When the :class:`Pickler` encounters an object of a type it knows nothing about
--- such as an extension type --- it looks in two places for a hint of how to
pickle it. One alternative is for the object to implement a :meth:`__reduce__`
@@ -541,6 +546,10 @@ unpickling as described above.
Pickling and unpickling external objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. index::
+ single: persistent_id (pickle protocol)
+ single: persistent_load (pickle protocol)
+
For the benefit of object persistence, the :mod:`pickle` module supports the
notion of a reference to an object outside the pickled data stream. Such
objects are referenced by a "persistent id", which is just an arbitrary string
@@ -630,6 +639,10 @@ with the :meth:`noload` method on the Unpickler.
Subclassing Unpicklers
----------------------
+.. index::
+ single: load_global() (pickle protocol)
+ single: find_global() (pickle protocol)
+
By default, unpickling will import any class that it finds in the pickle data.
You can control exactly what gets unpickled and what gets called by customizing
your unpickler. Unfortunately, exactly how you do this is different depending