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
f8baad0f
Commit
f8baad0f
authored
Nov 27, 2000
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch by Finn Bock to support PyStringMap in Jython.
parent
b7a52c9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Lib/copy.py
Lib/copy.py
+9
-0
No files found.
Lib/copy.py
View file @
f8baad0f
...
...
@@ -56,6 +56,11 @@ class Error(Exception):
pass
error
=
Error
# backward compatibility
try
:
from
org.python.core
import
PyStringMap
except
ImportError
:
PyStringMap
=
None
def
copy
(
x
):
"""Shallow copy operation on arbitrary Python objects.
...
...
@@ -104,6 +109,8 @@ d[types.TupleType] = _copy_tuple
def
_copy_dict
(
x
):
return
x
.
copy
()
d
[
types
.
DictionaryType
]
=
_copy_dict
if
PyStringMap
is
not
None
:
d
[
PyStringMap
]
=
_copy_dict
def
_copy_inst
(
x
):
if
hasattr
(
x
,
'__copy__'
):
...
...
@@ -200,6 +207,8 @@ def _deepcopy_dict(x, memo):
y
[
deepcopy
(
key
,
memo
)]
=
deepcopy
(
x
[
key
],
memo
)
return
y
d
[
types
.
DictionaryType
]
=
_deepcopy_dict
if
PyStringMap
is
not
None
:
d
[
PyStringMap
]
=
_deepcopy_dict
def
_keep_alive
(
x
,
memo
):
"""Keeps a reference to the object x in the memo.
...
...
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