File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ The :mod:`pickle` module differs from :mod:`marshal` in several significant ways
5959* :mod: `marshal ` cannot be used to serialize user-defined classes and their
6060 instances. :mod: `pickle ` can save and restore class instances transparently,
6161 however the class definition must be importable and live in the same module as
62- when the object was stored .
62+ when the object was pickled .
6363
6464* The :mod: `marshal ` serialization format is not guaranteed to be portable
6565 across Python versions. Because its primary job in life is to support
@@ -680,7 +680,10 @@ or both.
680680 If a string is returned, the string should be interpreted as the name of a
681681 global variable. It should be the object's local name relative to its
682682 module; the pickle module searches the module namespace to determine the
683- object's module. This behaviour is typically useful for singletons.
683+ object's module: for a given ``obj `` to be pickled, the ``__module__ ``
684+ attribute is looked up on ``obj `` directly, which falls back to a lookup
685+ on the type of ``obj `` if no ``__module__ `` instance attribute is set.
686+ This behaviour is typically useful for singletons.
684687
685688 When a tuple is returned, it must be between two and six items long.
686689 Optional items can either be omitted, or ``None `` can be provided as their
You can’t perform that action at this time.
0 commit comments