-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Extension module is already cached error with mypyc on Python 3.13 #17748
Comments
cc @ericsnowcurrently in case you happen to have time and kindness to take a look and offer any advice :-) |
Here's a repro that doesn't involve mypyc. I'll read more about multi-phase init tomorrow, maybe imports in single init is not allowed or something. mypyc does globals, which I think multi-phase init doesn't like, would be a big change
|
My understanding is that multi-phase init would solve the issue. I also encountered this when running tests on the release candidates, but I haven't had time to look into it in detail yet (and probably won't have time in the next week or two at least, unfortunately). Several mypyc tests fail because of this issue. We've been relying on circular imports working without multi-phase init for years now, even if they haven't been officially supported by the Python C API. Just to be clear, this also blocks compiling mypy on 3.13 release candidates, since mypy contains (many) import cycles. |
I opened python/cpython#123880 upstream |
This was fixed upstream, we should be all set for 3.13.0 |
Would be nice to make a release, I opened #17815 |
@cdce8p already bisected this upstream to python/cpython#118532
To Reproduce
Using a debug build of Python, you get:
Using a non-debug build, you get:
mypyc transpiles Python code to an extension module that uses the C API. In the above, we compile native.py into an extension module and form an import cycle with a normal pure Python module
The C code mypyc generates is visible in the build directory
The text was updated successfully, but these errors were encountered: