SF #904720: dict.update should take a 2-tuple sequence like dict.__init_
(Championed by Bob Ippolito.)
The update() method for mappings now accepts all the same argument forms
as the dict() constructor. This includes item lists and/or keyword
arguments.
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index 99554c7..f3c7c8c 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -86,41 +86,41 @@
self.assertRaises(TypeError, {}.keys, x=2, y=2)
def test_oldargs1_0(self):
- self.assertRaises(TypeError, {}.update)
+ self.assertRaises(TypeError, [].count)
def test_oldargs1_1(self):
- {}.update({})
+ [].count(1)
def test_oldargs1_2(self):
- self.assertRaises(TypeError, {}.update, {}, 1)
+ self.assertRaises(TypeError, [].count, 1, 2)
def test_oldargs1_0_ext(self):
try:
- {}.update(*())
+ [].count(*())
except TypeError:
pass
else:
raise RuntimeError
def test_oldargs1_1_ext(self):
- {}.update(*({},))
+ [].count(*(1,))
def test_oldargs1_2_ext(self):
try:
- {}.update(*({}, 2))
+ [].count(*(1, 2))
except TypeError:
pass
else:
raise RuntimeError
def test_oldargs1_0_kw(self):
- self.assertRaises(TypeError, {}.update, x=2)
+ self.assertRaises(TypeError, [].count, x=2)
def test_oldargs1_1_kw(self):
- self.assertRaises(TypeError, {}.update, {}, x=2)
+ self.assertRaises(TypeError, [].count, {}, x=2)
def test_oldargs1_2_kw(self):
- self.assertRaises(TypeError, {}.update, x=2, y=2)
+ self.assertRaises(TypeError, [].count, x=2, y=2)
def test_main():