summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_functools.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 9ccd0ca..a82ca7a 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -80,6 +80,15 @@ class TestPartial:
p(b=7)
self.assertEqual(d, {'a':3})
+ def test_kwargs_copy(self):
+ # Issue #29532: Altering a kwarg dictionary passed to a constructor
+ # should not affect a partial object after creation
+ d = {'a': 3}
+ p = self.partial(capture, **d)
+ self.assertEqual(p(), ((), {'a': 3}))
+ d['a'] = 5
+ self.assertEqual(p(), ((), {'a': 3}))
+
def test_arg_combinations(self):
# exercise special code paths for zero args in either partial
# object or the caller