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

Hello,
I’d like to hear opinions from scientific library maintainers – specifically, CPython’s C API users – on PEP 793

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.

Note that 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: PEP 793 – PyModExport: A new entry point for C extension modules - PEPs - Discussions on Python.org

Thanks for your time,
Petr

1 Like

Added a reply in the PEP discussion thread PEP 793 – PyModExport: A new entry point for C extension modules - #32 by ilayn - PEPs - Discussions on Python.org

1 Like