]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] Remove uninformative itertools recipe (GH-100253) (GH-100275)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 15 Dec 2022 18:47:58 +0000 (10:47 -0800)
committerGitHub <noreply@github.com>
Thu, 15 Dec 2022 18:47:58 +0000 (12:47 -0600)
Doc/library/itertools.rst

index 3d93c2c0573e09747b1b877fa728b6b5e647d9cb..ee70b16f42fbb90440864ecf35ae8f64b451c86f 100644 (file)
@@ -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))
@@ -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']