mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Remove uninformative itertools recipe (GH-100253)
This commit is contained in:
parent
b7e4f1d97c
commit
8356c14b4f
1 changed files with 0 additions and 7 deletions
|
|
@ -829,10 +829,6 @@ which incur interpreter overhead.
|
|||
"Count how many times the predicate is true"
|
||||
return sum(map(pred, iterable))
|
||||
|
||||
def pad_none(iterable):
|
||||
"Returns the sequence elements and then returns None indefinitely."
|
||||
return chain(iterable, repeat(None))
|
||||
|
||||
def ncycles(iterable, n):
|
||||
"Returns the sequence elements n times"
|
||||
return chain.from_iterable(repeat(tuple(iterable), n))
|
||||
|
|
@ -1193,9 +1189,6 @@ which incur interpreter overhead.
|
|||
>>> take(5, map(int, repeatfunc(random.random)))
|
||||
[0, 0, 0, 0, 0]
|
||||
|
||||
>>> list(islice(pad_none('abc'), 0, 6))
|
||||
['a', 'b', 'c', None, None, None]
|
||||
|
||||
>>> list(ncycles('abc', 3))
|
||||
['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c']
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue