MCPcopy Index your code
hub / github.com/python/cpython / list_sort_ascending_exchanged

Function list_sort_ascending_exchanged

Tools/scripts/sortperf.py:58–65  ·  view source on GitHub ↗
(size: int, rand: random.Random)

Source from the content-addressed store, hash-verified

56
57
58def list_sort_ascending_exchanged(size: int, rand: random.Random) -> list[float]:
59 result = list_sort_ascending(size, rand)
60 # Do 3 random exchanges.
61 for _ in range(3):
62 i1 = rand.randrange(size)
63 i2 = rand.randrange(size)
64 result[i1], result[i2] = result[i2], result[i1]
65 return result
66
67
68def list_sort_ascending_random(size: int, rand: random.Random) -> list[float]:

Callers

nothing calls this directly

Calls 2

list_sort_ascendingFunction · 0.85
randrangeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…