]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-118915: Document `PyUnstable_InterpreterState_GetMainModule` (GH-128483...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 10 Jan 2025 07:41:14 +0000 (08:41 +0100)
committerGitHub <noreply@github.com>
Fri, 10 Jan 2025 07:41:14 +0000 (08:41 +0100)
(cherry picked from commit ea39c8b08d8f025273bfa5b7a95f7b5984dc1e86)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Doc/c-api/init.rst

index d0632cb6fa172f768ee1ded7dab7d80e18907d3a..130942e070ef7ae3766a45c46a9fefee14f9e053 100644 (file)
@@ -1445,6 +1445,17 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
 
    .. versionadded:: 3.8
 
+
+.. c:function:: PyObject* PyUnstable_InterpreterState_GetMainModule(PyInterpreterState *interp)
+
+   Return a :term:`strong reference` to the ``__main__`` `module object <moduleobjects>`_
+   for the given interpreter.
+
+   The caller must hold the GIL.
+
+   .. versionadded:: 3.13
+
+
 .. c:type:: PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, _PyInterpreterFrame *frame, int throwflag)
 
    Type of a frame evaluation function.