Home
last modified time | relevance | path

Searched refs:cmp_to_key (Results 1 – 25 of 29) sorted by relevance

12

/external/python/cpython3/Lib/test/
Dtest_sort.py4 from functools import cmp_to_key
18 raw.sort(key=cmp_to_key(compare))
103 s.sort(key=cmp_to_key(lambda a, b: int(random.random() * 3) - 1))
160 self.assertRaises(ValueError, L.sort, key=cmp_to_key(mutating_cmp))
165 self.assertRaises(ValueError, L.sort, key=cmp_to_key(mutating_cmp))
180 copy.sort(key=cmp_to_key(my_cmp))
256 data.sort(key=cmp_to_key(my_cmp), reverse=True)
257 copy1.sort(key=cmp_to_key(my_cmp_reversed))
Dtest_functools.py811 key = self.cmp_to_key(cmp1)
818 key = self.cmp_to_key(cmp2)
827 key = self.cmp_to_key(mycmp=cmp1)
835 key = self.cmp_to_key() # too few args
837 key = self.cmp_to_key(cmp1, None) # too many args
838 key = self.cmp_to_key(cmp1)
847 key = self.cmp_to_key(cmp1)
862 key = self.cmp_to_key(mycmp=cmp1)
868 self.assertEqual(sorted(range(5), key=self.cmp_to_key(mycmp)),
876 values = sorted(values, key=self.cmp_to_key(mycmp))
[all …]
Dlist_tests.py7 from functools import cmp_to_key
502 u.sort(key=cmp_to_key(revcmp))
515 z.sort(key=cmp_to_key(myComparison))
528 key=cmp_to_key(selfmodifyingComparison))
/external/selinux/python/sepolgen/src/sepolgen/
Dutil.py150 def cmp_to_key(mycmp): function
169 from functools import cmp_to_key
Doutput.py134 rules.sort(key=util.cmp_to_key(rule_cmp))
158 ras.sort(key=util.cmp_to_key(role_type_cmp))
/external/python/cpython3/Doc/howto/
Dsorting.rst226 def cmp_to_key(mycmp):
249 from functools import cmp_to_key
253 >>> sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric))
256 In Python 3.2, the :func:`functools.cmp_to_key` function was added to the
/external/python/cpython2/Doc/howto/
Dsorting.rst239 def cmp_to_key(mycmp):
262 from functools import cmp_to_key
266 >>> sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric))
269 In Python 2.7, the :func:`functools.cmp_to_key` function was added to the
/external/python/cpython2/Lib/
Dfunctools.py80 def cmp_to_key(mycmp): function
Dpstats.py28 from functools import cmp_to_key
234 stats_list.sort(key=cmp_to_key(TupleComp(sort_tuple).compare))
/external/scapy/scapy/
Dcompat.py21 def cmp_to_key(mycmp): function
Dutils6.py76 cset.sort(key=cmp_to_key(cset_sort)) # Sort with global addresses first
156 candidate_set.sort(key=cmp_to_key(rfc3484_cmp), reverse=True)
Dautomaton.py446 v.sort(key=cmp_to_key(lambda t1_f1,t2_f2: cmp(t1_f1[0],t2_f2[0])))
451 v.sort(key=cmp_to_key(lambda c1,c2: cmp(c1.atmt_prio,c2.atmt_prio)))
453 … actlst.sort(key=cmp_to_key(lambda c1,c2: cmp(c1.atmt_cond[condname], c2.atmt_cond[condname])))
/external/python/cpython2/Doc/library/
Dfunctools.rst23 .. function:: cmp_to_key(func)
39 sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
Dfunctions.rst1321 each element only once. Use :func:`functools.cmp_to_key` to convert an
Dstdtypes.rst1759 element only once. Use :func:`functools.cmp_to_key` to convert an
/external/libxml2/python/
Dgenerator.py806 def cmp_to_key(mycmp): function
943 flist = sorted(flist, key=cmp_to_key(functionCompare))
1077 flist = sorted(flist, key=cmp_to_key(functionCompare))
/external/python/cpython3/Lib/
Dfunctools.py211 def cmp_to_key(mycmp): function
231 from _functools import cmp_to_key
Dpstats.py28 from functools import cmp_to_key
220 stats_list.sort(key=cmp_to_key(TupleComp(sort_tuple).compare))
/external/python/cpython2/Lib/unittest/
Dloader.py9 from functools import cmp_to_key as _CmpToKey
/external/python/cpython2/Lib/test/
Dtest_functools.py493 self.assertEqual(sorted(range(5), key=functools.cmp_to_key(mycmp)),
499 key = functools.cmp_to_key(mycmp)
/external/python/cpython3/Doc/library/
Dfunctools.rst23 .. function:: cmp_to_key(func)
39 sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
Dfunctions.rst1328 Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a
/external/python/cpython3/Lib/unittest/
Dloader.py231 testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))
/external/python/cpython3/Doc/whatsnew/
D3.2.rst822 * To aid in porting programs from Python 2, the :func:`functools.cmp_to_key`
827 >>> sorted(iterable, key=cmp_to_key(locale.strcoll)) # doctest: +SKIP
D2.7.rst1276 New function: :func:`~functools.cmp_to_key` will take an old-style comparison

12