Skip to content

Commit 2644080

Browse files
committed
Add example of intended usage before the API documentation
1 parent f6f5b1d commit 2644080

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Doc/c-api/stable.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,18 @@ mechanism, so that detectable incompatibilities raise exceptions rather than
218218
crash.
219219

220220
Most modules can use this check via the :c:data:`Py_mod_abi`
221-
slot and the :c:macro:`PyABIInfo_VAR` macro.
221+
slot and the :c:macro:`PyABIInfo_VAR` macro, for example like this:
222+
223+
.. code-block:: c
224+
225+
PyABIInfo_VAR(abi_info);
226+
227+
static PyModuleDef_Slot mymodule_slots[] = {
228+
{Py_mod_abi, &abi_info},
229+
...
230+
};
231+
232+
222233
The full API is described below for advanced use cases.
223234

224235
.. c:function:: int PyABIInfo_Check(PyABIInfo *info, const char *module_name)

0 commit comments

Comments
 (0)