summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorJohnny11502 <113304663+Johnny11502@users.noreply.github.com>2022-11-03 16:57:30 (GMT)
committerGitHub <noreply@github.com>2022-11-03 16:57:30 (GMT)
commit00b6745f16f8d1ffe8a9974677dbf00657a06805 (patch)
treef13c717dc4aeae37dbb1a973961d46d44bc73329 /Doc/c-api
parenta60ddd31be7ff96a8189e7483bf1eb2071d2bddf (diff)
downloadcpython-00b6745f16f8d1ffe8a9974677dbf00657a06805.zip
cpython-00b6745f16f8d1ffe8a9974677dbf00657a06805.tar.gz
cpython-00b6745f16f8d1ffe8a9974677dbf00657a06805.tar.bz2
gh-97909: PyMemberDef & PyGetSetDef members are not marked up (GH-98810)
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/structures.rst36
1 files changed, 19 insertions, 17 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 183ac14..5a20f07 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -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``)::