Skip to content

Commit 6e89141

Browse files
[3.12] Fix the PyGetSetDef documentation (GH-116056) (GH-116363)
closure is not a function pointer, it is a user data pointer. (cherry picked from commit df59401) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 0f5cd44 commit 6e89141

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/c-api/structures.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,20 +702,20 @@ Defining Getters and Setters
702702
703703
.. c:member:: void* closure
704704
705-
Optional function pointer, providing additional data for getter and setter.
705+
Optional user data pointer, providing additional data for getter and setter.
706706
707707
.. c:type:: PyObject *(*getter)(PyObject *, void *)
708708
709709
The ``get`` function takes one :c:expr:`PyObject*` parameter (the
710-
instance) and a function pointer (the associated ``closure``):
710+
instance) and a user data pointer (the associated ``closure``):
711711
712712
It should return a new reference on success or ``NULL`` with a set exception
713713
on failure.
714714
715715
.. c:type:: int (*setter)(PyObject *, PyObject *, void *)
716716
717717
``set`` functions take two :c:expr:`PyObject*` parameters (the instance and
718-
the value to be set) and a function pointer (the associated ``closure``):
718+
the value to be set) and a user data pointer (the associated ``closure``):
719719
720720
In case the attribute should be deleted the second parameter is ``NULL``.
721721
Should return ``0`` on success or ``-1`` with a set exception on failure.

0 commit comments

Comments
 (0)