Skip to content

Commit 9bd2c4e

Browse files
tomasr8miss-islington
authored andcommitted
gh-125756: Document Pickler.clear_memo() (GH-125762)
(cherry picked from commit 2542256) Co-authored-by: Tomas R. <[email protected]>
1 parent d78e113 commit 9bd2c4e

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
@@ -394,6 +394,15 @@ The :mod:`pickle` module exports three classes, :class:`Pickler`,
394394

395395
Use :func:`pickletools.optimize` if you need more compact pickles.
396396

397+
.. method:: clear_memo()
398+
399+
Clears the pickler's "memo".
400+
401+
The memo is the data structure that remembers which objects the
402+
pickler has already seen, so that shared or recursive objects
403+
are pickled by reference and not by value. This method is
404+
useful when re-using picklers.
405+
397406

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

0 commit comments

Comments
 (0)