Issue #25718: Fixed copying object with state with boolean value is false.
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py
index 6b64f10..aefc433 100644
--- a/Lib/test/test_copy.py
+++ b/Lib/test/test_copy.py
@@ -165,6 +165,9 @@
return cmp(self.foo, other.foo)
x = C(42)
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
@@ -395,6 +398,12 @@
x = C([42])
y = copy.deepcopy(x)
self.assertEqual(y, x)
+ self.assertIsNot(y, x)
+ 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.assertTrue(y is not x)
self.assertTrue(y.foo is not x.foo)