From: Peter Bierma Date: Thu, 9 Jan 2025 13:54:44 +0000 (-0500) Subject: gh-118915: Document `PyUnstable_InterpreterState_GetMainModule` (GH-128483) X-Git-Tag: v3.14.0a4~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea39c8b08d8f025273bfa5b7a95f7b5984dc1e86;p=thirdparty%2FPython%2Fcpython.git gh-118915: Document `PyUnstable_InterpreterState_GetMainModule` (GH-128483) --- diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index dd63dd013e32..97996a6f69dd 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -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 `_ + 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.