Skip to content

Commit

Permalink
add test for next with args
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Oct 19, 2022
1 parent 5960a6a commit 4882213
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/functional/s/stop_iteration_inside_generator.py
Expand Up @@ -154,3 +154,18 @@ def next():
it = iter(it)
while True:
yield next()

def other_safeiter(it):
"""Regression test for issue #7610 when ``next`` builtin is redefined"""

def next(*things):
print(*things)
while True:
try:
return next(it)
except StopIteration:
raise

it = iter(it)
while True:
yield next(1, 2)

0 comments on commit 4882213

Please sign in to comment.