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
fdcdb9ce
Commit
fdcdb9ce
authored
Jun 14, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy builtin functions as atomic. Fixes #746304. Will backport to 2.2.
parent
844a3acc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
Lib/copy.py
Lib/copy.py
+2
-0
Lib/test/test_copy.py
Lib/test/test_copy.py
+2
-2
Misc/NEWS
Misc/NEWS
+1
-0
No files found.
Lib/copy.py
View file @
fdcdb9ce
...
...
@@ -120,6 +120,7 @@ except AttributeError:
d
[
types
.
TypeType
]
=
_copy_atomic
d
[
types
.
XRangeType
]
=
_copy_atomic
d
[
types
.
ClassType
]
=
_copy_atomic
d
[
types
.
BuiltinFunctionType
]
=
_copy_atomic
def
_copy_list
(
x
):
return
x
[:]
...
...
@@ -233,6 +234,7 @@ except AttributeError:
d
[
types
.
TypeType
]
=
_deepcopy_atomic
d
[
types
.
XRangeType
]
=
_deepcopy_atomic
d
[
types
.
ClassType
]
=
_deepcopy_atomic
d
[
types
.
BuiltinFunctionType
]
=
_deepcopy_atomic
def
_deepcopy_list
(
x
,
memo
):
y
=
[]
...
...
Lib/test/test_copy.py
View file @
fdcdb9ce
...
...
@@ -84,7 +84,7 @@ class TestCopy(unittest.TestCase):
pass
tests
=
[
None
,
42
,
2L
**
100
,
3.14
,
True
,
False
,
1j
,
"hello"
,
u"hello
\
u1234
"
,
f
.
func_code
,
NewStyle
,
xrange
(
10
),
Classic
]
NewStyle
,
xrange
(
10
),
Classic
,
max
]
for
x
in
tests
:
self
.
assert_
(
copy
.
copy
(
x
)
is
x
,
`x`
)
...
...
@@ -257,7 +257,7 @@ class TestCopy(unittest.TestCase):
pass
tests
=
[
None
,
42
,
2L
**
100
,
3.14
,
True
,
False
,
1j
,
"hello"
,
u"hello
\
u1234
"
,
f
.
func_code
,
NewStyle
,
xrange
(
10
),
Classic
]
NewStyle
,
xrange
(
10
),
Classic
,
max
]
for
x
in
tests
:
self
.
assert_
(
copy
.
deepcopy
(
x
)
is
x
,
`x`
)
...
...
Misc/NEWS
View file @
fdcdb9ce
...
...
@@ -83,6 +83,7 @@ Library
- copy.py: applied SF patch 707900, fixing bug 702858, by Steven
Taschuk. Copying a new-style class that had a reference to itself
didn'
t
work
.
(
The
same
thing
worked
fine
for
old
-
style
classes
.)
Builtin
functions
are
now
treated
as
atomic
,
fixing
bug
#
746304.
-
difflib
.
py
has
two
new
functions
:
context_diff
()
and
unified_diff
().
...
...
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