summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-03-05 15:48:20 (GMT)
committerGitHub <noreply@github.com>2024-03-05 15:48:20 (GMT)
commitdf594011089a83d151ac7000954665536f3461b5 (patch)
treecc45c58cdcf53a446788acfb226a1bd13754cbfb /Doc/c-api
parent0064dfa0919cc93257c351a609f99461f6e4e3ac (diff)
downloadcpython-df594011089a83d151ac7000954665536f3461b5.zip
cpython-df594011089a83d151ac7000954665536f3461b5.tar.gz
cpython-df594011089a83d151ac7000954665536f3461b5.tar.bz2
Fix the PyGetSetDef documentation (GH-116056)
closure is not a function pointer, it is a user data pointer.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/structures.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index e2943f1..f9461ab 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -702,12 +702,12 @@ Defining Getters and Setters
.. c:member:: void* closure
- Optional function pointer, providing additional data for getter and setter.
+ Optional user data pointer, providing additional data for getter and setter.
.. c:type:: PyObject *(*getter)(PyObject *, void *)
The ``get`` function takes one :c:expr:`PyObject*` parameter (the
- instance) and a function pointer (the associated ``closure``):
+ instance) and a user data pointer (the associated ``closure``):
It should return a new reference on success or ``NULL`` with a set exception
on failure.
@@ -715,7 +715,7 @@ Defining Getters and Setters
.. c:type:: int (*setter)(PyObject *, PyObject *, void *)
``set`` functions take two :c:expr:`PyObject*` parameters (the instance and
- the value to be set) and a function pointer (the associated ``closure``):
+ the value to be set) and a user data pointer (the associated ``closure``):
In case the attribute should be deleted the second parameter is ``NULL``.
Should return ``0`` on success or ``-1`` with a set exception on failure.