if n > 2:
state = info[2]
else:
- state = {}
+ state = None
if n > 3:
listiter = info[3]
else:
y = callable(*args)
memo[id(x)] = y
- if state:
+ if state is not None:
if deep:
state = deepcopy(state, memo)
if hasattr(y, '__setstate__'):
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
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)