]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118915: Document `PyUnstable_InterpreterState_GetMainModule` (GH-128483)
authorPeter Bierma <zintensitydev@gmail.com>
Thu, 9 Jan 2025 13:54:44 +0000 (08:54 -0500)
committerGitHub <noreply@github.com>
Thu, 9 Jan 2025 13:54:44 +0000 (14:54 +0100)
Doc/c-api/init.rst

index dd63dd013e32dc98cefd156b602c6fab964c140a..97996a6f69dd22293ea50ad328024a75cb4cc5ca 100644 (file)
@@ -1492,6 +1492,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.