Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-123471: Make concurrent iteration over itertools.pairwise thread-safe#144489

Open
eendebakpt wants to merge 6 commits intopython:mainfrom
eendebakpt:pairwise_ft_v3
Open

gh-123471: Make concurrent iteration over itertools.pairwise thread-safe#144489
eendebakpt wants to merge 6 commits intopython:mainfrom
eendebakpt:pairwise_ft_v3

Conversation

@eendebakpt
Copy link
Contributor

@eendebakpteendebakpt commentedFeb 4, 2026
edited by bedevere-appbot
Loading

We use a critical section similar to the approach in#132814. The ideas from an earlier PR#125417 are too complex (or not sufficient for thread-safety).

We also avoid an incref/decref pair.

@rhettinger
Copy link
Contributor

rhettinger commentedFeb 5, 2026
edited
Loading

I'm thinking that this isn't the right strategy for itertools. Instead, we should implement the same semantics as for generators which is to raise an exception if a concurrent call occurs.

If a user wants concurrency for either generators or itertools, then they with need to wrap the iterators withserialize or a concurrent version oftee as discussed in the planning issue.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@rhettingerrhettingerAwaiting requested review from rhettingerrhettinger is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@eendebakpt@rhettinger

[8]ページ先頭

©2009-2026 Movatter.jp