Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.12] Fix the PyGetSetDef documentation (GH-116056) #116363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 6 Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -702,20 +702,20 @@ 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.

.. 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.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.