Replies: 3 comments 4 replies
-
|
Speaking only for myself, and as one who is not an expert in C extension modules, this PEP looks like a good thing. To be sure I'm understanding correctly, let me use my extension as an example. Also, let me ignore AArch64 and only list wheels for Linux x86_64. (Note that nanobind does not support the stable ABI until Python 3.12.) I currently have:
If your PEP is accepted and nanobind does as recommended, will it be possible to only add one more wheel:
|
Beta Was this translation helpful? Give feedback.
-
|
I'm also interested in collaborating on the unified wheel builds if this gets accepted. Maybe I overlooked it in the proposal, but does the token API help with accessing constructed modules in a thread-safe way for the case of multiple interpreters? I've seen a few PRs in different nanobind-using repos lately essentially building a thread-safe import cache for their modules, and I'm wondering if |
Beta Was this translation helpful? Give feedback.
-
|
Hi @encukou, this sounds very useful. If you provide such an API, nanobind will use it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'd like to hear opinions from nanobind contributors (and other binding maintainers) on PEP 793
What is this? I propose a new way to initialize C extension modules: rather than the current
PyInit_*function, you would definePyModExport_*. Rather than returning a module object orPyModuleDef, this function would return a C array of slots (same info as in aPyModuleDef, but laid out differently).This change is needed to support stable ABI for free-threaded CPython builds without hacks. See the PEP for the rationale, and all the details.
For nanobind, it looks like this would mean a change to the
PyInit_definitions -- annoying but localized -- in return for single-source compatibility with python 3.15+ and (as a separate extension/wheel) non-free-threaded stable ABI. (I'd be willing to collaborate on making that a single build if someone's interested, and the PEP is accepted.)What do you think?
Please reply here, or on the PEP's discussion thread: https://discuss.python.org/t/93444
Thanks for your time,
Petr
Beta Was this translation helpful? Give feedback.
All reactions