Skip to content

[mypyc] Make for loop over list memory-safe on free-threaded builds#21686

Merged
JukkaL merged 2 commits into
masterfrom
mypyc-safe-for-list
Jul 7, 2026
Merged

[mypyc] Make for loop over list memory-safe on free-threaded builds#21686
JukkaL merged 2 commits into
masterfrom
mypyc-safe-for-list

Conversation

@JukkaL

@JukkaL JukkaL commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Don't access list items directly but use CPython C API functions for item access. Also, reading the list length should use an atomic relaxed memory order read, but changing this is lower priority and won't be fixed until later. There is no change on non-free-threaded Python builds.

Work on mypyc/mypyc#1202.

@JukkaL JukkaL merged commit c07d788 into master Jul 7, 2026
18 checks passed
@JukkaL JukkaL deleted the mypyc-safe-for-list branch July 7, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants