Skip to content

Commit fb06581

Browse files
[3.14] gh-143928: Remove outdated comparison between pickle and marshal regarding recursion (GH-144025) (#144246)
gh-143928: Remove outdated comparison between pickle and marshal regarding recursion (GH-144025) (cherry picked from commit 923d9d2) Co-authored-by: Yashraj <yashrajpala8@gmail.com>
1 parent 237467f commit fb06581

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

Doc/library/pickle.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,6 @@ files.
5656

5757
The :mod:`pickle` module differs from :mod:`marshal` in several significant ways:
5858

59-
* The :mod:`pickle` module keeps track of the objects it has already serialized,
60-
so that later references to the same object won't be serialized again.
61-
:mod:`marshal` doesn't do this.
62-
63-
This has implications both for recursive objects and object sharing. Recursive
64-
objects are objects that contain references to themselves. These are not
65-
handled by marshal, and in fact, attempting to marshal recursive objects will
66-
crash your Python interpreter. Object sharing happens when there are multiple
67-
references to the same object in different places in the object hierarchy being
68-
serialized. :mod:`pickle` stores such objects only once, and ensures that all
69-
other references point to the master copy. Shared objects remain shared, which
70-
can be very important for mutable objects.
71-
7259
* :mod:`marshal` cannot be used to serialize user-defined classes and their
7360
instances. :mod:`pickle` can save and restore class instances transparently,
7461
however the class definition must be importable and live in the same module as

0 commit comments

Comments
 (0)