Lines Matching refs:fromkeys
216 self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
218 self.assertIsNot(d.fromkeys('abc'), d)
219 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
220 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
221 self.assertEqual(d.fromkeys([]), {})
224 self.assertEqual(d.fromkeys(g()), {1:None})
225 self.assertRaises(TypeError, {}.fromkeys, 3)
227 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
228 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
229 self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
230 self.assertIsInstance(dictlike().fromkeys('a'), dictlike)
234 ud = mydict.fromkeys('ab')
237 self.assertRaises(TypeError, dict.fromkeys)
245 self.assertRaises(Exc, baddict1.fromkeys, [1])
253 self.assertRaises(Exc, dict.fromkeys, BadSeq())
259 self.assertRaises(Exc, baddict2.fromkeys, [1])
263 self.assertEqual(dict.fromkeys(d, 0), dict(zip(range(6), [0]*6)))
271 self.assertEqual(baddict3.fromkeys({"a", "b", "c"}), res)
856 d = dict.fromkeys([x, y, z])
861 d = dict.fromkeys([x, y, z, o])
1171 dict.fromkeys(d) # shouldn't crash
1189 dict.fromkeys(d) # shouldn't crash