diff options
author | Victor Stinner <vstinner@python.org> | 2021-02-18 18:20:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 18:20:16 (GMT) |
commit | 44085a3fc9a150478aec1872dd1079c60dcc42f6 (patch) | |
tree | 1120f81009d599e9d5db25978e25ea4d757bc875 /Doc/c-api/function.rst | |
parent | cc96231f0a59cc7393943064800ecb6c18892662 (diff) | |
download | cpython-44085a3fc9a150478aec1872dd1079c60dcc42f6.zip cpython-44085a3fc9a150478aec1872dd1079c60dcc42f6.tar.gz cpython-44085a3fc9a150478aec1872dd1079c60dcc42f6.tar.bz2 |
bpo-42990: Refactor _PyFrame_New_NoTrack() (GH-24566)
* Refactor _PyFrame_New_NoTrack() and PyFunction_NewWithQualName()
code.
* PyFrame_New() checks for _PyEval_BuiltinsFromGlobals() failure.
* Fix a ref leak in _PyEval_BuiltinsFromGlobals() error path.
* Complete PyFunction_GetModule() documentation: it returns a
borrowed reference and it can return NULL.
* Move _PyEval_BuiltinsFromGlobals() definition to the internal C
API.
* PyFunction_NewWithQualName() uses _Py_IDENTIFIER() API for the
"__name__" string to make it compatible with subinterpreters.
Diffstat (limited to 'Doc/c-api/function.rst')
-rw-r--r-- | Doc/c-api/function.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst index 2096882..ad00842 100644 --- a/Doc/c-api/function.rst +++ b/Doc/c-api/function.rst @@ -61,9 +61,11 @@ There are a few functions specific to Python functions. .. c:function:: PyObject* PyFunction_GetModule(PyObject *op) - Return the *__module__* attribute of the function object *op*. This is normally - a string containing the module name, but can be set to any other object by - Python code. + Return a :term:`borrowed reference` to the *__module__* attribute of the + function object *op*. It can be *NULL*. + + This is normally a string containing the module name, but can be set to any + other object by Python code. .. c:function:: PyObject* PyFunction_GetDefaults(PyObject *op) |