Home
last modified time | relevance | path

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

1234

/external/python/cpython2/Lib/test/
Dtest_dict.py211 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)
[all …]
Dmapping_tests.py441 self.assertEqual(self.type2test.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
443 self.assertTrue(not(d.fromkeys('abc') is d))
444 self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
445 self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
446 self.assertEqual(d.fromkeys([]), {})
449 self.assertEqual(d.fromkeys(g()), {1:None})
450 self.assertRaises(TypeError, {}.fromkeys, 3)
452 self.assertEqual(dictlike.fromkeys('a'), {'a':None})
453 self.assertEqual(dictlike().fromkeys('a'), {'a':None})
454 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')
266 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:
/external/python/cpython3/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.py248 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)
[all …]
Dtest_iterlen.py118 d = dict.fromkeys(range(n))
125 d = dict.fromkeys(range(n))
132 d = dict.fromkeys(range(n))
Dtest_ordered_dict.py124 od = OrderedDict.fromkeys('abc')
126 od = OrderedDict.fromkeys('abc', value=None)
128 od = OrderedDict.fromkeys('abc', value=0)
182 od = OrderedDict.fromkeys('abc')
353 od = OrderedDict.fromkeys('abc')
406 od = OrderedDict.fromkeys('abcde')
425 od = OrderedDict.fromkeys('abc')
431 od = OrderedDict.fromkeys('abc')
448 od = OrderedDict.fromkeys(s)
768 od = OrderedDict.fromkeys('abcde')
Dtest_set.py48 self.d = dict.fromkeys(word)
79 for C in set, frozenset, dict.fromkeys, str, list, tuple:
108 for C in set, frozenset, dict.fromkeys, str, list, tuple:
128 for C in set, frozenset, dict.fromkeys, str, list, tuple:
154 for C in set, frozenset, dict.fromkeys, str, list, tuple:
181 for C in set, frozenset, dict.fromkeys, str, list, tuple:
336 d = dict.fromkeys(map(HashCountingInt, range(n)))
345 d2 = dict.fromkeys(set(d))
347 d3 = dict.fromkeys(frozenset(d))
349 d3 = dict.fromkeys(frozenset(d), 123)
[all …]
Dtest_pprint.py298 d = dict.fromkeys('cba')
699 self.assertEqual(clean(pprint.pformat(dict.fromkeys(keys))),
708 self.assertEqual(pprint.pformat(dict.fromkeys(keys, 0)),
726 self.assertEqual(pprint.pformat(dict.fromkeys([b, a]), width=1),
728 self.assertEqual(pprint.pformat(dict.fromkeys([a, b]), width=1),
Dtest_contains.py74 constructors = list, tuple, dict.fromkeys, set, frozenset, deque
Dtest_weakset.py32 self.d = dict.fromkeys(self.items)
69 for C in set, frozenset, dict.fromkeys, list, tuple:
91 for C in set, frozenset, dict.fromkeys, list, tuple:
/external/autotest/frontend/tko/
Dpreconfigs.py27 self._preconfigs['metrics'] = dict.fromkeys(
29 self._preconfigs['qual'] = dict.fromkeys(
/external/autotest/client/cros/video/
Darc_device_capability.py52 arc_caps = dict.fromkeys(self.MEDIA_CODEC_TO_CAPABILITY.values(), 'no')
Ddevice_capability.py71 autotest_caps = dict.fromkeys(managed_caps, 'no')
/external/python/cpython3/Lib/collections/
D__init__.py293 def fromkeys(cls, iterable, value=None): member in OrderedDict
638 def fromkeys(cls, iterable, v=None): member in Counter
952 d.update(dict.fromkeys(mapping)) # reuses stored hash values if possible
966 def fromkeys(cls, iterable, *args): member in ChainMap
968 return cls(dict.fromkeys(iterable, *args))
1119 def fromkeys(cls, iterable, value=None): member in UserDict
/external/python/asn1crypto/asn1crypto/
D_ordereddict.py118 def fromkeys(cls, iterable, value=None): member in OrderedDict
/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
/external/python/funcsigs/funcsigs/
Dodict.py227 def fromkeys(cls, iterable, value=None): member in OrderedDict
/external/python/setuptools/setuptools/command/
Dbdist_egg.py355 NATIVE_EXTENSIONS = dict.fromkeys('.dll .so .dylib .pyd'.split())
425 symbols = dict.fromkeys(iter_symbols(code))

1234