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
12f0cc32
Commit
12f0cc32
authored
Aug 09, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suggest using default values for __init__ arguments to make classes
unpicklable.
parent
4a5b27b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
Doc/lib/libpickle.tex
Doc/lib/libpickle.tex
+3
-1
Doc/libpickle.tex
Doc/libpickle.tex
+3
-1
No files found.
Doc/lib/libpickle.tex
View file @
12f0cc32
...
...
@@ -86,7 +86,9 @@ First of all, the class must be defined at the top level in a module.
\renewcommand
{
\indexsubitem
}{
(pickle protocol)
}
Next, it must normally be possible to create class instances by
calling the class without arguments. If this is undesirable, the
calling the class without arguments. Usually, this is best
accomplished by providing default values for all arguments to its
\code
{__
init
__}
method (if it has one). If this is undesirable, the
class can define a method
\code
{__
getinitargs
__
()
}
, which should
return a
{
\em
tuple
}
containing the arguments to be passed to the
class constructor (
\code
{__
init
__
()
}
).
...
...
Doc/libpickle.tex
View file @
12f0cc32
...
...
@@ -86,7 +86,9 @@ First of all, the class must be defined at the top level in a module.
\renewcommand
{
\indexsubitem
}{
(pickle protocol)
}
Next, it must normally be possible to create class instances by
calling the class without arguments. If this is undesirable, the
calling the class without arguments. Usually, this is best
accomplished by providing default values for all arguments to its
\code
{__
init
__}
method (if it has one). If this is undesirable, the
class can define a method
\code
{__
getinitargs
__
()
}
, which should
return a
{
\em
tuple
}
containing the arguments to be passed to the
class constructor (
\code
{__
init
__
()
}
).
...
...
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