]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Fix the PyGetSetDef documentation (GH-116056) (GH-116363)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 5 Mar 2024 16:16:50 +0000 (17:16 +0100)
committerGitHub <noreply@github.com>
Tue, 5 Mar 2024 16:16:50 +0000 (16:16 +0000)
closure is not a function pointer, it is a user data pointer.
(cherry picked from commit df594011089a83d151ac7000954665536f3461b5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/c-api/structures.rst

index 77f2b6991d770eb325592a10159a4a75b0a1d324..36a0abced0e3c598472c2e7ed3eb3cdbed9c3727 100644 (file)
@@ -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.