Skip to content

Commit 2ee01ec

Browse files
daxlabMariatta
authored andcommitted
[2.7] bpo-22392: Improve documentation for __getinitargs__ (GH-899)
1 parent d694a06 commit 2ee01ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/library/pickle.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,11 @@ Pickling and unpickling normal class instances
418418
When a pickled class instance is unpickled, its :meth:`__init__` method is
419419
normally *not* invoked. If it is desirable that the :meth:`__init__` method
420420
be called on unpickling, an old-style class can define a method
421-
:meth:`__getinitargs__`, which should return a *tuple* containing the
421+
:meth:`__getinitargs__`, which should return a *tuple* of positional
422422
arguments to be passed to the class constructor (:meth:`__init__` for
423-
example). The :meth:`__getinitargs__` method is called at pickle time; the
424-
tuple it returns is incorporated in the pickle for the instance.
423+
example). Keyword arguments are not supported. The :meth:`__getinitargs__`
424+
method is called at pickle time; the tuple it returns is incorporated in the
425+
pickle for the instance.
425426

426427
.. method:: object.__getnewargs__()
427428

0 commit comments

Comments
 (0)