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
e9cfcef7
Commit
e9cfcef7
authored
Nov 27, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify the interpretation of the __getstate__() return value for
new-style classes. Closes SF bug #637941.
parent
a01fa263
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Doc/lib/libpickle.tex
Doc/lib/libpickle.tex
+9
-3
No files found.
Doc/lib/libpickle.tex
View file @
e9cfcef7
...
...
@@ -412,13 +412,19 @@ Upon unpickling, if the class also defines the method
\method
{__
setstate
__
()
}
, it is called with the unpickled
state
\footnote
{
These methods can also be used to implement copying
class instances.
}
. If there is no
\method
{__
setstate
__
()
}
method, the
pickled
object
must be a dictionary and its items are assigned to the
pickled
state
must be a dictionary and its items are assigned to the
new instance's dictionary. If a class defines both
\method
{__
getstate
__
()
}
and
\method
{__
setstate
__
()
}
, the state object
needn't be a dictionary and these methods can do what they
want
\footnote
{
This protocol is also used by the shallow and deep
want
.
\footnote
{
This protocol is also used by the shallow and deep
copying operations defined in the
\refmodule
{
copy
}
module.
}
.
\refmodule
{
copy
}
module.
}
\begin{notice}
[warning]
For new-style classes, if
\method
{__
getstate
__
()
}
returns a false
value, the
\method
{__
setstate
__
()
}
method will not be called.
\end{notice}
\subsubsection
{
Pickling and unpickling extension types
}
...
...
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