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
2d2b6a00
Commit
2d2b6a00
authored
Feb 12, 1999
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Markup nits.
parent
99cd5735
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
Doc/lib/libcopy.tex
Doc/lib/libcopy.tex
+6
-12
No files found.
Doc/lib/libcopy.tex
View file @
2d2b6a00
\section
{
\module
{
copy
}
---
Shallow and deep copy operations
.
}
Shallow and deep copy operations
}
\declaremodule
{
standard
}{
copy
}
\modulesynopsis
{
Shallow and deep copy operations.
}
\withsubitem
{
(in module copy)
}{
%
\ttindex
{
copy
}
%
\ttindex
{
deepcopy
}}
This module provides generic (shallow and deep) copying operations.
\withsubitem
{
(in copy)
}{
\ttindex
{
copy()
}
\ttindex
{
deepcopy()
}}
Interface summary:
...
...
@@ -77,13 +75,11 @@ Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called
\method
{__
getinitargs
__
()
}
,
\method
{__
getstate
__
()
}
and
\method
{__
setstate
__
()
}
. See the description of module
\module
{
pickle
}
\refstmodindex
{
pickle
}
for information on these
\
ref
module
{
pickle
}
\refstmodindex
{
pickle
}
for information on these
methods. The
\module
{
copy
}
module does not use the
\module
{
copy
_
reg
}
registration module.
\withsubitem
{
(copy protocol)
}{
%
\ttindex
{__
getinitargs
__
()
}
%
\ttindex
{__
getstate
__
()
}
%
\ttindex
{__
setstate
__
()
}}
\withsubitem
{
(copy protocol)
}{
\ttindex
{__
getinitargs
__
()
}
\ttindex
{__
getstate
__
()
}
\ttindex
{__
setstate
__
()
}}
In order for a class to define its own copy implementation, it can
define special methods
\method
{__
copy
__
()
}
and
...
...
@@ -94,9 +90,7 @@ one argument, the memo dictionary. If the \method{__deepcopy__()}
implementation needs to make a deep copy of a component, it should
call the
\function
{
deepcopy()
}
function with the component as first
argument and the memo dictionary as second argument.
\withsubitem
{
(copy protocol)
}{
%
\ttindex
{__
copy
__
()
}
%
\ttindex
{__
deepcopy
__
()
}}
\withsubitem
{
(copy protocol)
}{
\ttindex
{__
copy
__
()
}
\ttindex
{__
deepcopy
__
()
}}
\begin{seealso}
\seemodule
{
pickle
}{
Discussion of the special disciplines used to
...
...
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