Home
last modified time | relevance | path

Searched refs:fromkeys (Results 1 – 25 of 47) sorted by relevance

12

/third_party/python/Lib/test/
Dmapping_tests.py424 self.assertEqual(self.type2test.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
426 self.assertTrue(not(d.fromkeys('abc') is d))
427 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
428 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
429 self.assertEqual(d.fromkeys([]), {})
432 self.assertEqual(d.fromkeys(g()), {1:None})
433 self.assertRaises(TypeError, {}.fromkeys, 3)
435 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
436 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
437 self.assertTrue(dictlike.fromkeys('a').__class__ is dictlike)
[all …]
Dtest_userdict.py39 self.assertEqual(collections.UserDict.fromkeys('one two'.split()), d4)
40 self.assertEqual(collections.UserDict().fromkeys('one two'.split()), d4)
41 self.assertEqual(collections.UserDict.fromkeys('one two'.split(), 1), d5)
42 self.assertEqual(collections.UserDict().fromkeys('one two'.split(), 1), d5)
43 self.assertTrue(u1.fromkeys('one two'.split()) is not u1)
44 self.assertIsInstance(u1.fromkeys('one two'.split()), collections.UserDict)
45 self.assertIsInstance(u2.fromkeys('one two'.split()), collections.UserDict)
Dtest_dict.py268 self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
270 self.assertIsNot(d.fromkeys('abc'), d)
271 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
272 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
273 self.assertEqual(d.fromkeys([]), {})
276 self.assertEqual(d.fromkeys(g()), {1:None})
277 self.assertRaises(TypeError, {}.fromkeys, 3)
279 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
280 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
281 self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
[all …]
Dtest_ordered_dict.py127 od = OrderedDict.fromkeys('abc')
129 od = OrderedDict.fromkeys('abc', value=None)
131 od = OrderedDict.fromkeys('abc', value=0)
185 od = OrderedDict.fromkeys('abc')
356 od = OrderedDict.fromkeys('abc')
409 od = OrderedDict.fromkeys('abcde')
428 od = OrderedDict.fromkeys('abc')
434 od = OrderedDict.fromkeys('abc')
451 od = OrderedDict.fromkeys(s)
783 od = OrderedDict.fromkeys('abcde')
Dtest_iterlen.py118 d = dict.fromkeys(range(n))
125 d = dict.fromkeys(range(n))
132 d = dict.fromkeys(range(n))
Dtest_set.py49 self.d = dict.fromkeys(word)
80 for C in set, frozenset, dict.fromkeys, str, list, tuple:
109 for C in set, frozenset, dict.fromkeys, str, list, tuple:
129 for C in set, frozenset, dict.fromkeys, str, list, tuple:
155 for C in set, frozenset, dict.fromkeys, str, list, tuple:
182 for C in set, frozenset, dict.fromkeys, str, list, tuple:
323 d = dict.fromkeys(map(HashCountingInt, range(n)))
332 d2 = dict.fromkeys(set(d))
334 d3 = dict.fromkeys(frozenset(d))
336 d3 = dict.fromkeys(frozenset(d), 123)
[all …]
Dtest_pprint.py391 d = dict.fromkeys('cba')
853 self.assertEqual(clean(pprint.pformat(dict.fromkeys(keys))),
862 self.assertEqual(pprint.pformat(dict.fromkeys(keys, 0)),
880 self.assertEqual(pprint.pformat(dict.fromkeys([b, a]), width=1),
882 self.assertEqual(pprint.pformat(dict.fromkeys([a, b]), width=1),
Dtest_contains.py74 constructors = list, tuple, dict.fromkeys, set, frozenset, deque
Dtest_weakset.py33 self.d = dict.fromkeys(self.items)
72 for C in set, frozenset, dict.fromkeys, list, tuple:
94 for C in set, frozenset, dict.fromkeys, list, tuple:
Dtest_genericalias.py141 self.assertEqual(dict.fromkeys(range(2)), {0: None, 1: None}) # This works
142 self.assertEqual(t.fromkeys(range(2)), {0: None, 1: None}) # Should be equivalent
Dtest_enumerate.py177 range(1,17,5), dict.fromkeys('abcde')):
Dtest_funcattrs.py424 self.assertEqual(dict.fromkeys.__qualname__, 'dict.fromkeys')
Dpickletester.py1752 self._test_recursive_collection_and_inst(dict.fromkeys)
1767 self._test_recursive_collection_and_inst(MyDict.fromkeys)
2226 x = dict.fromkeys(range(n))
2236 x = dict.fromkeys(range(n))
2796 (dict.fromkeys, (("a", 1), ("b", 2))),
Dtest_collections.py707 methodstubs = dict.fromkeys(names, lambda s, *args: 0)
2059 self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc')
2105 order = {letter: i for i, letter in enumerate(dict.fromkeys(ps + qs))}
2237 self.assertEqual(counter_result, dict.fromkeys(set_result, 1))
/third_party/python/Lib/collections/
D__init__.py276 def fromkeys(cls, iterable, value=None): member in OrderedDict
629 def fromkeys(cls, iterable, v=None): member in Counter
993 d.update(dict.fromkeys(mapping)) # reuses stored hash values if possible
1007 def fromkeys(cls, iterable, *args): member in ChainMap
1009 return cls(dict.fromkeys(iterable, *args))
1163 def fromkeys(cls, iterable, value=None): member in UserDict
/third_party/python/Lib/importlib/
Dreaders.py8 return iter(collections.OrderedDict.fromkeys(items))
/third_party/node/deps/v8/tools/release/
Dmerge_to_branch.py70 self["full_revision_list"] = list(OrderedDict.fromkeys(
Droll_merge.py71 self["full_revision_list"] = list(OrderedDict.fromkeys(
/third_party/mesa3d/src/panfrost/bifrost/
Dbifrost_isa.py328 lst = list(OrderedDict.fromkeys(modifier_lists[mod]))
/third_party/python/Lib/
Dshlex.py65 t = self.wordchars.maketrans(dict.fromkeys(punctuation_chars))
/third_party/python/Lib/idlelib/
Dpyparse.py119 trans = ParseMap.fromkeys(range(128), 120)
/third_party/littlefs/scripts/
Dsummary.py266 fields = list(co.OrderedDict.fromkeys(fields).keys())
282 by = list(co.OrderedDict.fromkeys(by).keys())
/third_party/python/Objects/
Ddictnotes.txt33 dict.fromkeys(seqn).keys()
/third_party/skia/third_party/externals/angle2/src/compiler/translator/
Dgen_builtin_symbols.py2091 mangled_names = list(dict.fromkeys(mangled_names))
2103 unmangled_names = list(dict.fromkeys(unmangled_names))
/third_party/python/Lib/importlib/metadata/
D__init__.py770 return dict.fromkeys(child.split(posixpath.sep, 1)[0] for child in names)

12