Lines Matching refs:fromkeys
211 self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
213 self.assertIsNot(d.fromkeys('abc'), d)
214 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
215 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
216 self.assertEqual(d.fromkeys([]), {})
219 self.assertEqual(d.fromkeys(g()), {1:None})
220 self.assertRaises(TypeError, {}.fromkeys, 3)
222 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
223 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
224 self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
225 self.assertIsInstance(dictlike().fromkeys('a'), dictlike)
229 ud = mydict.fromkeys('ab')
232 self.assertRaises(TypeError, dict.fromkeys)
240 self.assertRaises(Exc, baddict1.fromkeys, [1])
248 self.assertRaises(Exc, dict.fromkeys, BadSeq())
254 self.assertRaises(Exc, baddict2.fromkeys, [1])
258 self.assertEqual(dict.fromkeys(d, 0), dict(zip(range(6), [0]*6)))
266 self.assertEqual(baddict3.fromkeys({"a", "b", "c"}), res)
652 d = dict.fromkeys([x, y, z])
657 d = dict.fromkeys([x, y, z, o])
731 dict.fromkeys(d) # shouldn't crash
749 dict.fromkeys(d) # shouldn't crash