diff options
author | Gabriele N. Tornetta <P403n1x87@users.noreply.github.com> | 2021-07-07 11:21:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 11:21:51 (GMT) |
commit | 2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f (patch) | |
tree | 446776f951c764ef32fbe91e80c7928be0fe54b4 /Doc/c-api/function.rst | |
parent | 32096df0e00e692ee6dc688e62213bff0dffd573 (diff) | |
download | cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.zip cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.gz cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.bz2 |
bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)
Diffstat (limited to 'Doc/c-api/function.rst')
-rw-r--r-- | Doc/c-api/function.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Doc/c-api/function.rst b/Doc/c-api/function.rst index ad00842..56c1839 100644 --- a/Doc/c-api/function.rst +++ b/Doc/c-api/function.rst @@ -36,15 +36,16 @@ There are a few functions specific to Python functions. The function's docstring and name are retrieved from the code object. *__module__* is retrieved from *globals*. The argument defaults, annotations and closure are - set to ``NULL``. *__qualname__* is set to the same value as the function's name. + set to ``NULL``. *__qualname__* is set to the same value as the code object's + ``co_qualname`` field. .. c:function:: PyObject* PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname) As :c:func:`PyFunction_New`, but also allows setting the function object's ``__qualname__`` attribute. *qualname* should be a unicode object or ``NULL``; - if ``NULL``, the ``__qualname__`` attribute is set to the same value as its - ``__name__`` attribute. + if ``NULL``, the ``__qualname__`` attribute is set to the same value as the + code object's ``co_qualname`` field. .. versionadded:: 3.3 |