Skip to content

Commit eb9b09b

Browse files
authored
Correct import and update pairwise test cases
Fix import statement for pairwise in pairwise_iteration_tee function and update test cases.
1 parent 01298dc commit eb9b09b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎data_structures/arrays/pairwise_iteration.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
from collections.abc import Iterable, Iterator
11-
from itertools import pairwise, tee
11+
from itertools import tee
1212

1313

1414
def pairwise_iteration_tee(iterable: Iterable) -> Iterator[tuple]:
@@ -48,14 +48,15 @@ def pairwise_iteration_tee(iterable: Iterable) -> Iterator[tuple]:
4848
>>> list(pairwise_iteration_tee(['a']))
4949
[]
5050
51-
>>> all(pairwise_iteration_tee(test) == pairwise(test)
51+
>>> from itertools import pairwise
52+
>>> all(list(pairwise_iteration_tee(test)) == list(pairwise(test))
5253
... for test in (
5354
... [1, 2, 3],
5455
... (4, 3, 5),
5556
... {'x':3, 'y':1, 'z':2, 'foo':4},
5657
... '2345',
57-
... ['ATG','GCT','TGC','TAA']
58-
... []
58+
... ['ATG','GCT','TGC','TAA'],
59+
... [],
5960
... )
6061
"""
6162
# Uses itertools.tee to create two independent iterators (a and b)

0 commit comments

Comments
 (0)