mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788)
This commit is contained in:
parent
9c376bc1c4
commit
9923df9641
4 changed files with 18 additions and 6 deletions
|
|
@ -249,6 +249,10 @@ class TestChainMap(unittest.TestCase):
|
|||
for k, v in dict(a=1, B=20, C=30, z=100).items(): # check get
|
||||
self.assertEqual(d.get(k, 100), v)
|
||||
|
||||
c = ChainMap({'a': 1, 'b': 2})
|
||||
d = c.new_child(b=20, c=30)
|
||||
self.assertEqual(d.maps, [{'b': 20, 'c': 30}, {'a': 1, 'b': 2}])
|
||||
|
||||
def test_union_operators(self):
|
||||
cm1 = ChainMap(dict(a=1, b=2), dict(c=3, d=4))
|
||||
cm2 = ChainMap(dict(a=10, e=5), dict(b=20, d=4))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue