MCPcopy Create free account
hub / github.com/ActiveState/code / merge

Function merge

recipes/Python/141934_Merging_sorted_sequences/recipe-141934.py:38–45  ·  view source on GitHub ↗

Merge several sorted sequences into a sorted list. Assuming l1, l2, l3...ln sorted sequences, return a list that contain all the items of l1, l2, l3...ln in ascending order. Input values doesn't need to be lists: any iterable sequence can be used.

(*ln)

Source from the content-addressed store, hash-verified

36
37
38def merge(*ln):
39 """ Merge several sorted sequences into a sorted list.
40
41 Assuming l1, l2, l3...ln sorted sequences, return a list that contain
42 all the items of l1, l2, l3...ln in ascending order.
43 Input values doesn't need to be lists: any iterable sequence can be used.
44 """
45 return list(xmerge(*ln))

Callers

nothing calls this directly

Calls 2

listClass · 0.85
xmergeFunction · 0.85

Tested by

no test coverage detected