Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-97909: PyMemberDef & PyGetSetDef members are not marked up #98805

Closed
wants to merge 6 commits into from
Closed
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
36 changes: 19 additions & 17 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -485,23 +485,25 @@ Accessing attributes of extension types
Structure to define property-like access for a type. See also description of
the :c:member:`PyTypeObject.tp_getset` slot.

+-------------+------------------+-----------------------------------+
| Field | C Type | Meaning |
+=============+==================+===================================+
| name | const char \* | attribute name |
+-------------+------------------+-----------------------------------+
| get | getter | C function to get the attribute |
+-------------+------------------+-----------------------------------+
| set | setter | optional C function to set or |
| | | delete the attribute, if omitted |
| | | the attribute is readonly |
+-------------+------------------+-----------------------------------+
| doc | const char \* | optional docstring |
+-------------+------------------+-----------------------------------+
| closure | void \* | optional function pointer, |
| | | providing additional data for |
| | | getter and setter |
+-------------+------------------+-----------------------------------+
.. c:member:: const char* PyGetSetDef.name

attribute name

.. c:member:: getter PyGetSetDef.get

C funtion to get the attribute.

.. c:member:: setter PyGetSetDef.set

Optional C function to set or delete the attribute, if omitted the attribute is readonly.

.. c:member:: const char\* PyGetSetDef.doc

optional docstring

.. c:member:: void \* PyGetSetDef.closure

Optional function pointer, providing additional data for getter and setter.

The ``get`` function takes one :c:expr:`PyObject*` parameter (the
instance) and a function pointer (the associated ``closure``)::
Expand Down