Lines Matching refs:fromkeys
248 self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
250 self.assertIsNot(d.fromkeys('abc'), d)
251 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
252 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
253 self.assertEqual(d.fromkeys([]), {})
256 self.assertEqual(d.fromkeys(g()), {1:None})
257 self.assertRaises(TypeError, {}.fromkeys, 3)
259 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
260 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
261 self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
262 self.assertIsInstance(dictlike().fromkeys('a'), dictlike)
266 ud = mydict.fromkeys('ab')
269 self.assertRaises(TypeError, dict.fromkeys)
277 self.assertRaises(Exc, baddict1.fromkeys, [1])
285 self.assertRaises(Exc, dict.fromkeys, BadSeq())
291 self.assertRaises(Exc, baddict2.fromkeys, [1])
295 self.assertEqual(dict.fromkeys(d, 0), dict(zip(range(6), [0]*6)))
303 self.assertEqual(baddict3.fromkeys({"a", "b", "c"}), res)
915 d = dict.fromkeys([x, y, z])
920 d = dict.fromkeys([x, y, z, o])
1296 dict.fromkeys(d) # shouldn't crash
1314 dict.fromkeys(d) # shouldn't crash