See PEP 793. I'll copy the abstract for reference:
In this PEP, we propose a new entry point for C extension modules, by which one can define a module using an array of PyModuleDef_Slot structures without an enclosing PyModuleDef structure. This allows extension authors to avoid using a statically allocated PyObject, lifting the most common obstacle to making one compiled library file usable with both regular and free-threaded builds of CPython.
To make this viable, we also specify new module slot types to replace PyModuleDef’s fields, and to allow adding a token similar to the Py_tp_token used for type objects.
We also add an API for defining modules from slots dynamically.
The existing API (PyInit_*) is soft-deprecated. (That is: it will continue to work without warnings, and it’ll be fully documented and supported, but we plan to not add any new features to it.)
@encukou I am trying to update a library to include this feature in 3.15, and I am wondering if the PY_VERSION_HEX for this version is 0x030F0000. Does this version exist?
I am trying to update a library to include this feature in 3.15, and I am wondering if the PY_VERSION_HEX for this version is 0x030F0000. Does this version exist?
Sorry, I missed the notification.
To use wording in the docs: 0x030F0000 does not correspond to any Python release, but is useful in numeric comparisons.
Activity
gh-140550: Initial implementation of PEP 793 – PyModExport (GH-140556)
pythongh-140550: Run make regen-limited-abi
gh-140550: Run make regen-limited-abi (#141056)
pythongh-140550: PEP 793 reference documentation
pythongh-140550: Removp PyInit function from test_cext
encukou commented on Nov 13, 2025
I'd appreciate a review of the reference docs update: #141197
pythongh-140550: Use a bool for the Py_mod_gil value
gh-140550: Use a bool for the Py_mod_gil value (GH-141519)
gh-140550: PEP 793 reference documentation (GH-141197)
pythongh-140550: Initial implementation of PEP 793 – PyModExport (pyt…
pythongh-140550: Run make regen-limited-abi (python#141056)
pythongh-140550: Use a bool for the Py_mod_gil value (pythonGH-141519)
10 remaining items
davin-core commented on Mar 24, 2026
@encukou I am trying to update a library to include this feature in 3.15, and I am wondering if the PY_VERSION_HEX for this version is 0x030F0000. Does this version exist?
pythongh-140550: allow slots that repeat information from PyModuleDef (…
gh-140550: Single What's New highlight for PEPs 793, 803 and 820 (GH-…
gh-140550: Update xxlimited with 3.15 limited API (GH-142827)
[3.15] gh-140550: Update xxlimited with 3.15 limited API (GH-142827) (G…
encukou commented on Jun 18, 2026
@davin-core
Sorry, I missed the notification.
To use wording in the docs: 0x030F0000 does not correspond to any Python release, but is useful in numeric comparisons.
You can use 0x030F0000 to mean "3.15+" in e.g.:
gh-140550: Docs additions & fixups for PEP 793 (GH-151661)
[3.15] gh-140550: Docs additions & fixups for PEP 793 (GH-151661) (GH…
pythongh-140550: Enable limited C API tests on Free Threading in test…
pythongh-140550: Enable limited C API tests on Free Threading in test…
pythongh-140550: Fix PyABIInfo_VAR macro: avoid ";"
gh-140550: Fix PyABIInfo_VAR macro: avoid ";" (#157539)
[3.15] gh-140550: Fix PyABIInfo_VAR macro: avoid ";" (#157494)
gh-140550: Enable limited C API tests on Free Threading in test_cext (#…
[3.15] gh-140550: Enable limited C API tests on Free Threading in tes…