Commit cbac8ce5 authored by Raymond Hettinger's avatar Raymond Hettinger

Fixup docstrings for merge().

parent 382abeff
...@@ -96,8 +96,8 @@ timestamped entries from multiple log files). Returns an iterator over ...@@ -96,8 +96,8 @@ timestamped entries from multiple log files). Returns an iterator over
over the sorted values. over the sorted values.
Similar to \code{sorted(itertools.chain(*iterables))} but returns an iterable, Similar to \code{sorted(itertools.chain(*iterables))} but returns an iterable,
does not pull the data into memory all at once, and reduces the number of does not pull the data into memory all at once, and assumes that each of the
comparisons by assuming that each of the input streams is already sorted. input streams is already sorted (smallest to largest).
\versionadded{2.6} \versionadded{2.6}
\end{funcdesc} \end{funcdesc}
......
...@@ -312,8 +312,8 @@ def merge(*iterables): ...@@ -312,8 +312,8 @@ def merge(*iterables):
'''Merge multiple sorted inputs into a single sorted output. '''Merge multiple sorted inputs into a single sorted output.
Similar to sorted(itertools.chain(*iterables)) but returns an iterable, Similar to sorted(itertools.chain(*iterables)) but returns an iterable,
does not pull the data into memory all at once, and reduces the number does not pull the data into memory all at once, and assumes that each of
of comparisons by assuming that each of the input streams is already sorted. the input streams is already sorted (smallest to largest).
>>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25])) >>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
[0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25] [0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment