Skip to content

Commit 2542256

Browse files
authored
gh-125756: Document Pickler.clear_memo() (GH-125762)
1 parent a1d4b1c commit 2542256

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/library/pickle.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,15 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
401401

402402
Use :func:`pickletools.optimize` if you need more compact pickles.
403403

404+
.. method:: clear_memo()
405+
406+
Clears the pickler's "memo".
407+
408+
The memo is the data structure that remembers which objects the
409+
pickler has already seen, so that shared or recursive objects
410+
are pickled by reference and not by value. This method is
411+
useful when re-using picklers.
412+
404413

405414
.. class:: Unpickler(file, *, fix_imports=True, encoding="ASCII", errors="strict", buffers=None)
406415

0 commit comments

Comments
 (0)