runner icon indicating copy to clipboard operation
runner copied to clipboard

Add more-itertools for python

Open Captain-Quack opened this issue 2 years ago • 0 comments

Please complete the following information about the package:

The following are optional, but will help us consider adding:

  • Why is this useful? Provides a ton of cool tools for routine tasks, like iterable chunking, peaking at generators, and combinatorics
  • Example Code: Taken from the Api:
>>>  list(chunked([1, 2, 3, 4, 5, 6], 3))
[[1, 2, 3], [4, 5, 6]]
>>> [''.join(s) for s in substrings('more')]
['m', 'o', 'r', 'e', 'mo', 'or', 're', 'mor', 'ore', 'more']
>>> from more_itertools import spy
>>> iterable = (x * x for x in range(1, 6))
>>> head, iterable = spy(iterable, n=3)
>>> list(head)
[1, 4, 9]
>>> list(iterable)
[1, 4, 9, 16, 25]

:+1: reaction might help to get this request prioritized.

Captain-Quack avatar Feb 24 '23 23:02 Captain-Quack