Skip to content

Commit 9d2dcbb

Browse files
[3.11] Remove uninformative itertools recipe (GH-100253) (GH-100275)
1 parent cb1001c commit 9d2dcbb

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

Doc/library/itertools.rst

-7
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,6 @@ which incur interpreter overhead.
790790
"Count how many times the predicate is true"
791791
return sum(map(pred, iterable))
792792

793-
def pad_none(iterable):
794-
"Returns the sequence elements and then returns None indefinitely."
795-
return chain(iterable, repeat(None))
796-
797793
def ncycles(iterable, n):
798794
"Returns the sequence elements n times"
799795
return chain.from_iterable(repeat(tuple(iterable), n))
@@ -1163,9 +1159,6 @@ which incur interpreter overhead.
11631159
>>> take(5, map(int, repeatfunc(random.random)))
11641160
[0, 0, 0, 0, 0]
11651161

1166-
>>> list(islice(pad_none('abc'), 0, 6))
1167-
['a', 'b', 'c', None, None, None]
1168-
11691162
>>> list(ncycles('abc', 3))
11701163
['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c']
11711164

0 commit comments

Comments
 (0)