8000 gh-105201: Add PyIter_NextItem() by erlend-aasland · Pull Request #122331 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-105201: Add PyIter_NextItem() #122331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address Bénédikt's review
  • Loading branch information
erlend-aasland committed Jul 27, 2024
commit 210c0e1e62f87f4b0762e291e3f70bf3753a3aef
12 changes: 7 additions & 5 deletions Lib/test/test_capi/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,17 @@ def check_negative_refcount(self, code):
br'object has negative ref count')

def run_iter_api_test(self, next_func):
inputs = [ (), (1,2,3),
[], [1,2,3]]
dataset = (
(), (1,2,3),
[], [1,2,3],
)

for inp in inputs:
for input_ in dataset:
items = []
it = iter(inp)
it = iter(input_)
while (item := next_func(it)) is not None:
items.append(item)
self.assertEqual(items, list(inp))
self.assertEqual(items, list(input_))

class Broken:
def __init__(self):
Expand Down
2 changes: 1 addition & 1 deletion Misc/stable_abi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2509,4 +2509,4 @@
[function.Py_TYPE]
added = '3.14'
[function.PyIter_NextItem]
added = '3.15'
added = '3.14'
Loading
0