Opinions wanted for PEP 793 – PyModExpo rt: A new entry point for C extension modules

Petr Viktorin via NumPy-Discussion <[email protected]>
Newsgroups gmane.comp.python.numeric.general
Message-ID <[email protected]>
Hello,
I'd like to hear opinions from NumPy team's (and other scientific library maintainers) on PEP 793: https://peps.python.org/pep-0793/

What is this? I propose a new way to initialize C extension modules: rather than the current `PyInit_*` function, you would define `PyModExport_*`. Rather than returning a module object or `PyModuleDef`, this function would return a C array of slots (same info as in a `PyModuleDef`, 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 NumPy, this means that if the plan is to support the stable ABI sooner than 2029 (when y'all drop support for Python 3.14), some compatibility code will be needed to provide both `PyInit` for 3.14 and `PyModExport` for newer versions. (Drafts for the compatibility code weigh in at 70-250 lines depending on how robustness/reusability/commented-ness.)
For projects that don't want stable ABI for free-threaded CPython, nothing changes -- `PyInit_*` will continue to work.

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
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/numpy-discussion.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.