From e31265b8286e04386624d926661c5ab87160a346 Mon Sep 17 00:00:00 2001 From: Sanjay-VK07 Date: Sun, 25 Jan 2026 23:12:53 +0530 Subject: [PATCH] Docs: remove outdated marshal recursion and object sharing claim --- Doc/library/pickle.rst | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst index 3a9b66ec7e7088..1e7c73a5f0b8c7 100644 --- a/Doc/library/pickle.rst +++ b/Doc/library/pickle.rst @@ -56,18 +56,8 @@ files. The :mod:`pickle` module differs from :mod:`marshal` in several significant ways: -* The :mod:`pickle` module keeps track of the objects it has already serialized, +* * The :mod:`pickle` module keeps track of the objects it has already serialized, so that later references to the same object won't be serialized again. - :mod:`marshal` doesn't do this. - - This has implications both for recursive objects and object sharing. Recursive - objects are objects that contain references to themselves. These are not - handled by marshal, and in fact, attempting to marshal recursive objects will - crash your Python interpreter. Object sharing happens when there are multiple - references to the same object in different places in the object hierarchy being - serialized. :mod:`pickle` stores such objects only once, and ensures that all - other references point to the master copy. Shared objects remain shared, which - can be very important for mutable objects. * :mod:`marshal` cannot be used to serialize user-defined classes and their instances. :mod:`pickle` can save and restore class instances transparently,