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
cbbec1c5
Kaydet (Commit)
cbbec1c5
authored
Kas 30, 2015
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #25718: Fixed copying object with state with boolean value is false.
üst
7279befc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
copy.py
Lib/copy.py
+2
-2
test_copy.py
Lib/test/test_copy.py
+9
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/copy.py
Dosyayı görüntüle @
cbbec1c5
...
@@ -281,7 +281,7 @@ def _reconstruct(x, info, deep, memo=None):
...
@@ -281,7 +281,7 @@ def _reconstruct(x, info, deep, memo=None):
if
n
>
2
:
if
n
>
2
:
state
=
info
[
2
]
state
=
info
[
2
]
else
:
else
:
state
=
{}
state
=
None
if
n
>
3
:
if
n
>
3
:
listiter
=
info
[
3
]
listiter
=
info
[
3
]
else
:
else
:
...
@@ -295,7 +295,7 @@ def _reconstruct(x, info, deep, memo=None):
...
@@ -295,7 +295,7 @@ def _reconstruct(x, info, deep, memo=None):
y
=
callable
(
*
args
)
y
=
callable
(
*
args
)
memo
[
id
(
x
)]
=
y
memo
[
id
(
x
)]
=
y
if
state
:
if
state
is
not
None
:
if
deep
:
if
deep
:
state
=
deepcopy
(
state
,
memo
)
state
=
deepcopy
(
state
,
memo
)
if
hasattr
(
y
,
'__setstate__'
):
if
hasattr
(
y
,
'__setstate__'
):
...
...
Lib/test/test_copy.py
Dosyayı görüntüle @
cbbec1c5
...
@@ -180,6 +180,9 @@ class TestCopy(unittest.TestCase):
...
@@ -180,6 +180,9 @@ class TestCopy(unittest.TestCase):
return
self
.
foo
==
other
.
foo
return
self
.
foo
==
other
.
foo
x
=
C
(
42
)
x
=
C
(
42
)
self
.
assertEqual
(
copy
.
copy
(
x
),
x
)
self
.
assertEqual
(
copy
.
copy
(
x
),
x
)
# State with boolean value is false (issue #25718)
x
=
C
(
0.0
)
self
.
assertEqual
(
copy
.
copy
(
x
),
x
)
# The deepcopy() method
# The deepcopy() method
...
@@ -448,6 +451,12 @@ class TestCopy(unittest.TestCase):
...
@@ -448,6 +451,12 @@ class TestCopy(unittest.TestCase):
self
.
assertEqual
(
y
,
x
)
self
.
assertEqual
(
y
,
x
)
self
.
assertIsNot
(
y
,
x
)
self
.
assertIsNot
(
y
,
x
)
self
.
assertIsNot
(
y
.
foo
,
x
.
foo
)
self
.
assertIsNot
(
y
.
foo
,
x
.
foo
)
# State with boolean value is false (issue #25718)
x
=
C
([])
y
=
copy
.
deepcopy
(
x
)
self
.
assertEqual
(
y
,
x
)
self
.
assertIsNot
(
y
,
x
)
self
.
assertIsNot
(
y
.
foo
,
x
.
foo
)
def
test_deepcopy_reflexive_inst
(
self
):
def
test_deepcopy_reflexive_inst
(
self
):
class
C
:
class
C
:
...
...
Misc/NEWS
Dosyayı görüntüle @
cbbec1c5
...
@@ -113,6 +113,8 @@ Core and Builtins
...
@@ -113,6 +113,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #25718: Fixed copying object with state with boolean value is false.
- Issue #10131: Fixed deep copying of minidom documents. Based on patch
- Issue #10131: Fixed deep copying of minidom documents. Based on patch
by Marian Ganisin.
by Marian Ganisin.
...
...
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