8000 [3.14] gh-135755: Docs: C API: Document missing `PyFunction_GET*` mac… · python/cpython@349f4c2 · GitHub
[go: up one dir, main page]

Skip to content
  • Commit 349f4c2

    Browse files
    miss-islingtonZeroIntensitybrianschubertencukou
    authored
    [3.14] gh-135755: Docs: C API: Document missing PyFunction_GET* macros (GH-135762) (GH-135916)
    gh-135755: Docs: C API: Document missing `PyFunction_GET*` macros (GH-135762) (cherry picked from commit ca87a47) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Brian Schubert <brianm.schubert@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
    1 parent 090a42b commit 349f4c2

    File tree

    2 files changed

    +44
    -0
    lines changed

    2 files changed

    +44
    -0
    lines changed

    Doc/c-api/function.rst

    Lines changed: 20 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -95,6 +95,13 @@ There are a few functions specific to Python functions.
    9595
    9696
    .. versionadded:: 3.12
    9797
    98+
    99+
    .. c:function:: PyObject* PyFunction_GetKwDefaults(PyObject *op)
    100+
    101+
    Return the keyword-only argument default values of the function object *op*. This can be a
    102+
    dictionary of arguments or ``NULL``.
    103+
    104+
    98105
    .. c:function:: PyObject* PyFunction_GetClosure(PyObject *op)
    99106
    100107
    Return the closure associated with the function object *op*. This can be ``NULL``
    @@ -123,6 +130,19 @@ There are a few functions specific to Python functions.
    123130
    Raises :exc:`SystemError` and returns ``-1`` on failure.
    124131
    125132
    133+
    .. c:function:: PyObject *PyFunction_GET_CODE(PyObject *op)
    134+
    PyObject *PyFunction_GET_GLOBALS(PyObject *op)
    135+
    PyObject *PyFunction_GET_MODULE(PyObject *op)
    136+
    PyObject *PyFunction_GET_DEFAULTS(PyObject *op)
    137+
    PyObject *PyFunction_GET_KW_DEFAULTS(PyObject *op)
    138+
    PyObject *PyFunction_GET_CLOSURE(PyObject *op)
    139+
    PyObject *PyFunction_GET_ANNOTATIONS(PyObject *op)
    140+
    141+
    These functions are similar to their ``PyFunction_Get*`` counterparts, but
    142+
    do not do type checking. Passing anything other than an instance of
    143+
    :c:data:`PyFunction_Type` is undefined behavior.
    144+
    145+
    126146
    .. c:function:: int PyFunction_AddWatcher(PyFunction_WatchCallback callback)
    127147
    128148
    Register *callback* as a function watcher for the current interpreter.
    10000

    Doc/data/refcounts.dat

    Lines changed: 24 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -963,21 +963,45 @@ PyFunction_Check:PyObject*:o:0:
    963963
    PyFunction_GetAnnotations:PyObject*::0:
    964964
    PyFunction_GetAnnotations:PyObject*:op:0:
    965965

    966+
    PyFunction_GET_ANNOTATIONS:PyObject*::0:
    967+
    PyFunction_GET_ANNOTATIONS:PyObject*:op:0:
    968+
    966969
    PyFunction_GetClosure:PyObject*::0:
    967970
    PyFunction_GetClosure:PyObject*:op:0:
    968971

    972+
    PyFunction_GET_CLOSURE:PyObject*::0:
    973+
    PyFunction_GET_CLOSURE:PyObject*:op:0:
    974+
    969975
    PyFunction_GetCode:PyObject*::0:
    970976
    PyFunction_GetCode:PyObject*:op:0:
    971977

    978+
    PyFunction_GET_CODE:PyObject*::0:
    979+
    PyFunction_GET_CODE:PyObject*:op:0:
    980+
    972981
    PyFunction_GetDefaults:PyObject*::0:
    973982
    PyFunction_GetDefaults:PyObject*:op:0:
    974983

    984+
    PyFunction_GET_DEFAULTS:PyObject*::0:
    985+
    PyFunction_GET_DEFAULTS:PyObject*:op:0:
    986+
    987+
    PyFunction_GetKwDefaults:PyObject*::0:
    988+
    PyFunction_GetKwDefaults:PyObject*:op:0:
    989+
    990+
    PyFunction_GET_KW_DEFAULTS:PyObject*::0:
    991+
    PyFunction_GET_KW_DEFAULTS:PyObject*:op:0:
    992+
    975993
    PyFunction_GetGlobals:PyObject*::0:
    976994
    PyFunction_GetGlobals:PyObject*:op:0:
    977995

    996+
    PyFunction_GET_GLOBALS:PyObject*::0:
    997+
    PyFunction_GET_GLOBALS:PyObject*:op:0:
    998+
    978999
    PyFunction_GetModule:PyObject*::0:
    9791000
    PyFunction_GetModule:PyObject*:op:0:
    9801001

    1002+
    PyFunction_GET_MODULE:PyObject*::0:
    1003+
    PyFunction_GET_MODULE:PyObject*:op:0:
    1004+
    9811005
    PyFunction_New:PyObject*::+1:
    9821006
    PyFunction_New:PyObject*:code:+1:
    9831007
    PyFunction_New:PyObject*:globals:+1:

    0 commit comments

    Comments
     (0)
    0