Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2ee01ecf
Commit
2ee01ecf
authored
Mar 31, 2017
by
Mandeep Singh
Committed by
Mariatta
Mar 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.7] bpo-22392: Improve documentation for __getinitargs__ (GH-899)
parent
d694a062
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Doc/library/pickle.rst
Doc/library/pickle.rst
+4
-3
No files found.
Doc/library/pickle.rst
View file @
2ee01ecf
...
...
@@ -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__()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment