heapq.merge
Lazily merges pre-sorted streams into one ordered stream.
CKTIS / Python
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Lazily merges pre-sorted streams into one ordered stream.
Selects the largest items in descending comparison-key order.
Selects the smallest items in ascending comparison-key order.
Defines the common interface for buffered binary streams with byte-oriented reads and writes.
Creates a seekable in-memory binary stream.
Provides an in-memory text stream for reading, writing and capturing Unicode text.
Defines the base interface for character-oriented streams, including decoded text reads.
The iterator method returns the next item and raises StopIteration when exhausted.
Yields successive running totals, or successive results of a supplied binary operation.
Consumes an iterable in consecutive tuples of at most the requested size.
Yields the members of each input iterable to form one consecutive sequence.
Enumerates selections of positions without replacement in input order.
Enumerates selections whose positions may be reused while their order stays nondecreasing.
Yields data items paired with truthy selectors.
Produces an unbounded arithmetic progression from a starting point and step.
Caches items from the input and then repeats them in order.
Skips an initial run while the predicate holds, then yields the rest unchanged.
Yields items for which the predicate returns a falsy result.
Groups consecutive items that share a key and yields a key plus a group iterator.
Lazily selects positions from an iterable using nonnegative bounds.
Yields overlapping pairs of neighboring input items.
Enumerates ordered selections of distinct input positions.
Generates the Cartesian product with the rightmost input advancing fastest.
Yields the same object repeatedly, optionally for a fixed number of iterations.