You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 66da5fc
Browse filesBrowse the repository at this point in the historyBrowse files
pythongh-149557: Raise RuntimeError on re-entrant itertools.pairwise.__next__
Add a per-iterator `running` flag, set/cleared via atomic test-and-set, so
a recursive or concurrent call to `pairwise.__next__` raises RuntimeError
instead of crashing or producing garbled output. Matches the long-standing
behavior of `itertools.tee` and generators. With re-entry blocked, the
defensive re-read guard and incref/decref pair added by pythongh-109788 are no
longer needed and have been removed.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
0 commit comments