Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Doc/library/pickle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ files.
The :mod:`!pickle` module differs from :mod:`marshal` in several significant ways:

* :mod:`marshal` cannot be used to serialize user-defined classes and their
instances. :mod:`!pickle` can save and restore class instances transparently,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? It's still accurate.

however the class definition must be importable and live in the same module as
when the object was stored.
instances. :mod:`!pickle` can save and restore class instances transparently.

* The :mod:`marshal` serialization format is not guaranteed to be portable
across Python versions. Because its primary job in life is to support
Expand Down Expand Up @@ -693,7 +691,10 @@ or both.
If a string is returned, the string should be interpreted as the name of a
global variable. It should be the object's local name relative to its
module; the pickle module searches the module namespace to determine the
object's module. This behaviour is typically useful for singletons.
object's module: for a given ``obj`` to be pickled, the ``__module__``
attribute is looked up on ``obj`` directly, which falls back to a lookup
on the type of ``obj`` if no ``__module__`` instance attribute is set.
This behaviour is typically useful for singletons.

When a tuple is returned, it must be between two and six items long.
Optional items can either be omitted, or ``None`` can be provided as their
Expand Down
Loading