Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
d16f57bf
Kaydet (Commit)
d16f57bf
authored
Kas 28, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert Collins.
üst
c63392c1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
0 deletions
+19
-0
copy.py
Lib/copy.py
+4
-0
test_copy.py
Lib/test/test_copy.py
+11
-0
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/copy.py
Dosyayı görüntüle @
d16f57bf
...
...
@@ -260,6 +260,10 @@ d[dict] = _deepcopy_dict
if
PyStringMap
is
not
None
:
d
[
PyStringMap
]
=
_deepcopy_dict
def
_deepcopy_method
(
x
,
memo
):
# Copy instance methods
return
type
(
x
)(
x
.
im_func
,
deepcopy
(
x
.
im_self
,
memo
),
x
.
im_class
)
_deepcopy_dispatch
[
types
.
MethodType
]
=
_deepcopy_method
def
_keep_alive
(
x
,
memo
):
"""Keeps a reference to the object x in the memo.
...
...
Lib/test/test_copy.py
Dosyayı görüntüle @
d16f57bf
...
...
@@ -672,6 +672,17 @@ class TestCopy(unittest.TestCase):
del
d
self
.
assertEqual
(
len
(
v
),
1
)
def
test_deepcopy_bound_method
(
self
):
class
Foo
(
object
):
def
m
(
self
):
pass
f
=
Foo
()
f
.
b
=
f
.
m
g
=
copy
.
deepcopy
(
f
)
self
.
assertEqual
(
g
.
m
,
g
.
b
)
self
.
assertTrue
(
g
.
b
.
im_self
is
g
)
g
.
b
()
def
global_foo
(
x
,
y
):
return
x
+
y
...
...
Misc/ACKS
Dosyayı görüntüle @
d16f57bf
...
...
@@ -145,6 +145,7 @@ Josh Cogliati
Dave Cole
Benjamin Collar
Jeffery Collins
Robert Collins
Paul Colomiets
Matt Conway
David M. Cooke
...
...
Misc/NEWS
Dosyayı görüntüle @
d16f57bf
...
...
@@ -483,6 +483,9 @@ Core and Builtins
Library
-------
- Issue #1515: Enable use of deepcopy() with instance methods. Patch by
Robert Collins.
- Issue #7403: logging: Fixed possible race condition in lock creation.
- Issue #6845: Add restart support for binary upload in ftplib. The
...
...
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