Skip to content

GH-134160: Prefer multi-phase initialisation in docs #134764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add a heading for module slots
  • Loading branch information
AA-Turner committed May 27, 2025
commit 23a46a252496f461f8fed32387142aab168f375b
11 changes: 6 additions & 5 deletions Doc/c-api/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@
.. versionadded:: 3.5

The *m_slots* member of the module definition must point to an array of
``PyModuleDef_Slot`` structures:
:c:type:`PyModuleDef_Slot` structures, terminated by a slot with id 0.

See :PEP:`489` for more details on multi-phase initialization.

Module slots
............

.. c:type:: PyModuleDef_Slot

Expand All @@ -310,8 +315,6 @@

.. versionadded:: 3.5

The *m_slots* array must be terminated by a slot with id 0.

The available slot types are:

.. c:macro:: Py_mod_create
Expand Down Expand Up @@ -422,8 +425,6 @@

.. versionadded:: 3.13

See :PEP:`489` for more details on multi-phase initialization.

.. _single-phase-initialization:

Single-phase initialization
Expand All @@ -441,7 +442,7 @@

.. c:function:: PyObject* PyModule_Create(PyModuleDef *def)

Create a new module object, given the definition in *def*. This behaves

Check warning on line 445 in Doc/c-api/module.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:macro reference target not found: PYTHON_API_VERSION [ref.macro]
like :c:func:`PyModule_Create2` with *module_api_version* set to
:c:macro:`PYTHON_API_VERSION`.

Expand Down
Loading