Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc85a15

Browse files
committed
Fix method name in documentation (__setstate__ --> __getstate__)
2 parents 805ae0d + a6d0dd5 commit cc85a15

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Doc/library/pickle.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,9 @@ The following types can be pickled:
390390

391391
* classes that are defined at the top level of a module
392392

393-
* instances of such classes whose :attr:`__dict__` or :meth:`__setstate__` is
394-
picklable (see section :ref:`pickle-inst` for details)
393+
* instances of such classes whose :attr:`__dict__` or the result of calling
394+
:meth:`__getstate__` is picklable (see section :ref:`pickle-inst` for
395+
details).
395396

396397
Attempts to pickle unpicklable objects will raise the :exc:`PicklingError`
397398
exception; when this happens, an unspecified number of bytes may have already
@@ -402,8 +403,8 @@ raised in this case. You can carefully raise this limit with
402403

403404
Note that functions (built-in and user-defined) are pickled by "fully qualified"
404405
name reference, not by value. This means that only the function name is
405-
pickled, along with the name of the module the function is defined in. Neither the
406-
function's code, nor any of its function attributes are pickled. Thus the
406+
pickled, along with the name of the module the function is defined in. Neither
407+
the function's code, nor any of its function attributes are pickled. Thus the
407408
defining module must be importable in the unpickling environment, and the module
408409
must contain the named object, otherwise an exception will be raised. [#]_
409410

0 commit comments

Comments
 (0)