8000 gh-89189: More compact range iterator by serhiy-storchaka · Pull Request #27986 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-89189: More compact range iterator #27986

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 12 commits into from
Nov 30, 2022
Merged
Prev Previous commit
Next Next commit
Merge branch 'main' into range-iter
  • Loading branch information
serhiy-storchaka committed Aug 29, 2021
commit 214f204c7114efe1f523de7e4354adce816706f0
6 changes: 1 addition & 5 deletions Lib/test/test_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,7 @@ def test_iterator_pickling_overflowing_index(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
with self.subTest(proto=proto):
it = iter(range(2**32 + 2))
_, _, idx = it.__reduce__()
self.assertEqual(idx, 0)
it.__setstate__(2**32 + 1) # undocumented way to set r->index
_, _, idx = it.__reduce__()
self.assertEqual(idx, 2**32 + 1)
it.__setstate__(2**32 + 1) # undocumented way to advance an iterator
d = pickle.dumps(it, proto)
it = pickle.loads(d)
self.assertEqual(next(it), 2**32 + 1)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0