https://github.com/python/cpython/commit/9756d8c63737042db611205b0c33c353d5dbd9c3
commit: 9756d8c63737042db611205b0c33c353d5dbd9c3
branch: 3.13
author: Petr Viktorin <[email protected]>
committer: encukou <[email protected]>
date: 2025-11-26T15:34:57+01:00
summary:

[3.13] gh-141909: Add `PyModuleDef_Slot` and earlier Py_mod_* constants to 
stable ABI manifest (#141910) (GH-141977)

These were added to the limited API in 3.5-3.12.
Not including them in `Misc/stable_abi.toml` was a bug.

(cherry picked from commit 202fce0dbde1da32d8abc2eb59ddfce6f6a3c9fa)

files:
M Doc/c-api/module.rst
M Doc/data/stable_abi.dat
M Misc/stable_abi.toml

diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst
index 927fc3afe58a45..23a4cfb0e473a9 100644
--- a/Doc/c-api/module.rst
+++ b/Doc/c-api/module.rst
@@ -404,6 +404,8 @@ The available slot types are:
    ``PyModuleDef`` has non-``NULL`` ``m_traverse``, ``m_clear``,
    ``m_free``; non-zero ``m_size``; or slots other than ``Py_mod_create``.
 
+   .. versionadded:: 3.5
+
 .. c:macro:: Py_mod_exec
 
    Specifies a function that is called to *execute* the module.
@@ -418,6 +420,8 @@ The available slot types are:
    If multiple ``Py_mod_exec`` slots are specified, they are processed in the
    order they appear in the *m_slots* array.
 
+   .. versionadded:: 3.5
+
 .. c:macro:: Py_mod_multiple_interpreters
 
    Specifies one of the following values:
diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat
index 61fae7b886c57a..9156c24ef16cd0 100644
--- a/Doc/data/stable_abi.dat
+++ b/Doc/data/stable_abi.dat
@@ -442,6 +442,7 @@ data,PyMethodDescr_Type,3.2,,
 type,PyModuleDef,3.2,,full-abi
 type,PyModuleDef_Base,3.2,,full-abi
 func,PyModuleDef_Init,3.5,,
+type,PyModuleDef_Slot,3.5,,full-abi
 data,PyModuleDef_Type,3.5,,
 func,PyModule_Add,3.13,,
 func,PyModule_AddFunctions,3.7,,
@@ -945,6 +946,10 @@ macro,Py_bf_getbuffer,3.11,,
 macro,Py_bf_releasebuffer,3.11,,
 type,Py_buffer,3.11,,full-abi
 type,Py_intptr_t,3.2,,
+macro,Py_mod_create,3.5,,
+macro,Py_mod_exec,3.5,,
+macro,Py_mod_gil,3.13,,
+macro,Py_mod_multiple_interpreters,3.12,,
 macro,Py_mp_ass_subscript,3.2,,
 macro,Py_mp_length,3.2,,
 macro,Py_mp_subscript,3.2,,
diff --git a/Misc/stable_abi.toml b/Misc/stable_abi.toml
index e07a7939013c6c..ddae123e1fa5fc 100644
--- a/Misc/stable_abi.toml
+++ b/Misc/stable_abi.toml
@@ -40,7 +40,7 @@
 # - struct_abi_kind: for `struct`, defines how much of the struct is exposed:
 #   - 'full-abi': All of the struct is part of the ABI, including the size
 #     (users may define arrays of these structs).
-#     Typically used for initalization, rather than at runtime.
+#     Typically used for initialization, rather than at runtime.
 #   - 'opaque': No members are part of the ABI, nor is the size. The Limited
 #     API only handles these via pointers. The C definition should be
 #     incomplete (opaque).
@@ -1889,6 +1889,13 @@
     added = '3.5'
 [data.PyModuleDef_Type]
     added = '3.5'
+[const.Py_mod_create]
+    added = '3.5'
+[const.Py_mod_exec]
+    added = '3.5'
+[struct.PyModuleDef_Slot]
+    added = '3.5'
+    struct_abi_kind = 'full-abi'
 
 # New slots in 3.5:
 # d51374ed78a3e3145911a16cdf3b9b84b3ba7d15 - Matrix multiplication (PEP 465)
@@ -2431,6 +2438,9 @@
     added = '3.12'
 [const.Py_TPFLAGS_ITEMS_AT_END]
     added = '3.12'
+[const.Py_mod_multiple_interpreters]
+    added = '3.12'
+
 [function.PyImport_AddModuleRef]
     added = '3.13'
 [function.PyWeakref_GetRef]
@@ -2509,3 +2519,6 @@
     added = '3.13'
 [function.PyEval_GetFrameLocals]
     added = '3.13'
+[const.Py_mod_gil]
+    added = '3.13'
+

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to