Skip to content

Commit 9a9246d

Browse files
committed
Add callable iterator test
1 parent fd3fcc2 commit 9a9246d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/snippets/iterable.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ def __getitem__(self, x):
3030
class C: pass
3131
assert_raises(TypeError, lambda: 5 in C())
3232
assert_raises(TypeError, iter, C)
33+
34+
it = iter([1,2,3,4,5])
35+
call_it = iter(lambda: next(it), 4)
36+
assert list(call_it) == [1,2,3]

0 commit comments

Comments
 (0)