gh-116146: Add C-API to create module from spec and initfunc#139196
gh-116146: Add C-API to create module from spec and initfunc#139196encukou merged 15 commits intopython:mainfrom
Conversation
f9cd705 to
4363e5a
Compare
encukou
left a comment
There was a problem hiding this comment.
This looks reasonable.
I'm proposing a replacement for Init functions in PEP-793, but that PEP adds PyModule_FromSlotsAndSpec and PyModule_Exec which should work for similar use cases.
Would it make sense to switch the spec & initfunc arguments to match that proposal?
I'm not sure if the word Builtin in the name is necessary -- is that to match the internal create_builtin? Would something like PyImport_LoadModuleFromInitfuncAndSpec work better?
Do you want to submit this to the C API WG?
No, it's not even accepted :)
Just go to the WG :) |
done :) capi-workgroup/decisions#77 |
- use `PyImport_CreateModuleFromInitfunc` for the new API - no need to introduce `create_builtin_ex` - update `create_builtin` and all callers - update exception message
4363e5a to
781a730
Compare
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
|
I left my suggestions as a PR: itamaro#27 |
* Test single-phase init as well; don't use private APIs in test * Doc update --------- Co-authored-by: Itamar Oren <itamarost@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
…on under the free-threaded build
8f16533 to
1165950
Compare
vstinner
left a comment
There was a problem hiding this comment.
The new function PyImport_CreateModuleFromInitfunc() should be documented in Doc/whatsnew/3.15.rst.
Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
fabafb5 to
fbfde0a
Compare
vstinner
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the updates!
…ythonGH-139196) Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>

C-API WG decision: capi-workgroup/decisions#77