]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix typo and add a module prefix (GH-28401)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 17 Sep 2021 05:12:37 +0000 (22:12 -0700)
committerPablo Galindo <pablogsal@gmail.com>
Wed, 29 Sep 2021 11:34:35 +0000 (12:34 +0100)
(cherry picked from commit 80d9ff16483b6c1898bcdcc811b5450b57a5e573)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/library/itertools.rst

index 8341ce321b1b204b3e13d8bf5f4f0d33ccacd970..61d8b869711fa49b008c0ae6881697491d78b31c 100644 (file)
@@ -821,14 +821,14 @@ which incur interpreter overhead.
 
    def triplewise(iterable):
        "Return overlapping triplets from an iterable"
-       # pairwise('ABCDEFG') -> ABC BCD CDE DEF EFG
+       # triplewise('ABCDEFG') -> ABC BCD CDE DEF EFG
        for (a, _), (b, c) in pairwise(pairwise(iterable)):
            yield a, b, c
 
    def sliding_window(iterable, n):
        # sliding_window('ABCDEFG', 4) -> ABCD BCDE CDEF DEFG
        it = iter(iterable)
-       window = deque(islice(it, n), maxlen=n)
+       window = collections.deque(islice(it, n), maxlen=n)
        if len(window) == n:
            yield tuple(window)
        for x in it: