Home
last modified time | relevance | path

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

12

/external/python/cpython2/Lib/test/
Dtest_dict.py210 self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
212 self.assertIsNot(d.fromkeys('abc'), d)
213 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
214 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
215 self.assertEqual(d.fromkeys([]), {})
218 self.assertEqual(d.fromkeys(g()), {1:None})
219 self.assertRaises(TypeError, {}.fromkeys, 3)
221 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
222 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
223 self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
[all …]
Dmapping_tests.py440 self.assertEqual(self.type2test.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
442 self.assertTrue(not(d.fromkeys('abc') is d))
443 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
444 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
445 self.assertEqual(d.fromkeys([]), {})
448 self.assertEqual(d.fromkeys(g()), {1:None})
449 self.assertRaises(TypeError, {}.fromkeys, 3)
451 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
452 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
453 self.assertTrue(dictlike.fromkeys('a').__class__ is dictlike)
[all …]
Dtest_userdict.py40 self.assertEqual(UserDict.UserDict.fromkeys('one two'.split()), d4)
41 self.assertEqual(UserDict.UserDict().fromkeys('one two'.split()), d4)
42 self.assertEqual(UserDict.UserDict.fromkeys('one two'.split(), 1), d5)
43 self.assertEqual(UserDict.UserDict().fromkeys('one two'.split(), 1), d5)
44 self.assertTrue(u1.fromkeys('one two'.split()) is not u1)
45 self.assertIsInstance(u1.fromkeys('one two'.split()), UserDict.UserDict)
46 self.assertIsInstance(u2.fromkeys('one two'.split()), UserDict.IterableUserDict)
277 def fromkeys(cls, keys, value=None): member in SeqDict
Dtest_iterlen.py133 d = dict.fromkeys(xrange(n))
140 d = dict.fromkeys(xrange(n))
147 d = dict.fromkeys(xrange(n))
Dtest_set.py47 self.d = dict.fromkeys(word)
78 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
107 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
127 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
153 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
180 for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
314 d = dict.fromkeys(map(HashCountingInt, xrange(n)))
323 d2 = dict.fromkeys(set(d))
325 d3 = dict.fromkeys(frozenset(d))
327 d3 = dict.fromkeys(frozenset(d), 123)
[all …]
Dtest_ordered_dict.py218 od = OrderedDict.fromkeys('abc')
253 od = OrderedDict.fromkeys(s)
Dtest_weakset.py51 self.d = dict.fromkeys(self.items)
88 for C in set, frozenset, dict.fromkeys, list, tuple:
110 for C in set, frozenset, dict.fromkeys, list, tuple:
Dtest_importhooks.py93 self.namestoblock = dict.fromkeys(namestoblock)
Dtest_random.py106 self.gen.sample(dict.fromkeys('abcdefghijklmnopqrst'), 2)
109 a = dict.fromkeys(range(10)+range(10,100,2)+range(100,110))
Dpickletester.py988 self.check_recursive_collection_and_inst(dict.fromkeys)
1003 self.check_recursive_collection_and_inst(MyDict.fromkeys)
1328 x = dict.fromkeys(range(n))
1337 x = dict.fromkeys(range(n))
Dtest_collections.py269 methodstubs = dict.fromkeys(names, lambda s, *args: 0)
897 self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc')
1022 self.assertEqual(counter_result, dict.fromkeys(set_result, 1))
Dtest_builtin.py1674 s = ''.join(dict.fromkeys(s).keys()) # unique letters only
1675 types = [set, frozenset, list, tuple, dict.fromkeys]
/external/autotest/frontend/tko/
Dpreconfigs.py27 self._preconfigs['metrics'] = dict.fromkeys(
29 self._preconfigs['qual'] = dict.fromkeys(
/external/autotest/client/tests/ltp/
Dparse_ltp_out.py75 filter_accumulator = dict.fromkeys(test_filters.keys(), 0)
/external/autotest/client/site_tests/kernel_LTP/
Dparse_ltp_out.py71 filter_accumulator = dict.fromkeys(test_filters.keys(), 0)
/external/python/cpython2/Doc/howto/
Ddescriptor.rst406 :func:`dict.fromkeys` creates a new dictionary from a list of keys. The pure
411 def fromkeys(klass, iterable, value=None):
417 fromkeys = classmethod(fromkeys)
421 >>> Dict.fromkeys('abracadabra')
/external/python/cpython2/Lib/
Dcollections.py209 def fromkeys(cls, iterable, value=None): member in OrderedDict
522 def fromkeys(cls, iterable, v=None): member in Counter
DUserDict.py106 def fromkeys(cls, iterable, value=None): member in UserDict
Dhttplib.py1069 header_names = dict.fromkeys([k.lower() for k in headers])
/external/v8/tools/release/
Dmerge_to_branch.py69 self["full_revision_list"] = list(OrderedDict.fromkeys(
Droll_merge.py71 self["full_revision_list"] = list(OrderedDict.fromkeys(
/external/autotest/client/cros/
Dec.py401 flash_dict = dict.fromkeys(['ptype', 'vid', 'pid', 'dev_major',
/external/python/cpython2/Lib/distutils/tests/
Dsetuptools_build_ext.py190 libnames = dict.fromkeys([lib._full_name for lib in self.shlibs])
/external/selinux/python/sepolicy/sepolicy/
Dmanpage.py157 alphabet_manpages = dict.fromkeys(string.ascii_letters, [])
/external/python/cpython2/Objects/
Ddictnotes.txt34 dict.fromkeys(seqn).keys()

12