From: Mandeep Singh Date: Thu, 30 Mar 2017 20:39:06 +0000 (+0530) Subject: [2.7] bpo-22392: Improve documentation for __getinitargs__ (GH-899) X-Git-Tag: v2.7.14rc1~229 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ee01ecf419a392f0b6a33ca10d1f747adb6c43a;p=python [2.7] bpo-22392: Improve documentation for __getinitargs__ (GH-899) --- diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst index 41be2c4eb6..67f27de1ce 100644 --- a/Doc/library/pickle.rst +++ b/Doc/library/pickle.rst @@ -418,10 +418,11 @@ Pickling and unpickling normal class instances When a pickled class instance is unpickled, its :meth:`__init__` method is normally *not* invoked. If it is desirable that the :meth:`__init__` method be called on unpickling, an old-style class can define a method - :meth:`__getinitargs__`, which should return a *tuple* containing the + :meth:`__getinitargs__`, which should return a *tuple* of positional arguments to be passed to the class constructor (:meth:`__init__` for - example). The :meth:`__getinitargs__` method is called at pickle time; the - tuple it returns is incorporated in the pickle for the instance. + example). Keyword arguments are not supported. The :meth:`__getinitargs__` + method is called at pickle time; the tuple it returns is incorporated in the + pickle for the instance. .. method:: object.__getnewargs__()