KEMBAR78
[mypyc] Enable free threading when compiling multiple modules by JukkaL · Pull Request #19541 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jul 30, 2025

Previously we used multi-phase initialization to enable free threading on Python builds that support it, but only if a single module was compiled in a group.

Implements it also for multiple modules in a group. Add support for multi-phase initialization in module shims and the shared library. It's still only used on free-threaded builds, and we fall back to the old approach on other Python versions/builds.

This enables compiling mypy and mypyc on free-threaded Python builds. At least almost all mypy and mypyc tests now pass when compiled and on 3.14.0b4 with free threading (only tested on macOS so far).

@JukkaL JukkaL merged commit 43364c1 into master Jul 30, 2025
13 checks passed
@JukkaL JukkaL deleted the mypyc-multiphase-init-2 branch July 30, 2025 16:20
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