We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03f25cc commit 81c9affCopy full SHA for 81c9aff
Doc/library/itertools.rst
@@ -821,14 +821,14 @@ which incur interpreter overhead.
821
822
def triplewise(iterable):
823
"Return overlapping triplets from an iterable"
824
- # pairwise('ABCDEFG') -> ABC BCD CDE DEF EFG
+ # triplewise('ABCDEFG') -> ABC BCD CDE DEF EFG
825
for (a, _), (b, c) in pairwise(pairwise(iterable)):
826
yield a, b, c
827
828
def sliding_window(iterable, n):
829
# sliding_window('ABCDEFG', 4) -> ABCD BCDE CDEF DEFG
830
it = iter(iterable)
831
- window = deque(islice(it, n), maxlen=n)
+ window = collections.deque(islice(it, n), maxlen=n)
832
if len(window) == n:
833
yield tuple(window)
834
for x in it:
0 commit comments