Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,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))
Expand Down Expand Up @@ -1163,9 +1159,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']

Expand Down