diff options
author | Petr Viktorin <encukou@gmail.com> | 2023-05-29 11:54:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 11:54:14 (GMT) |
commit | 1668b41dc477bc9562e4c50ab36a232839b4621b (patch) | |
tree | b80eeeb05c1bec08934cf1ddaeb043c7e98138ff /Doc/c-api | |
parent | bfd20d257e4ad16a25f4bac0ea4dbb719cdf6bc7 (diff) | |
download | cpython-1668b41dc477bc9562e4c50ab36a232839b4621b.zip cpython-1668b41dc477bc9562e4c50ab36a232839b4621b.tar.gz cpython-1668b41dc477bc9562e4c50ab36a232839b4621b.tar.bz2 |
gh-97908: CAPI docs: Remove repeated struct names from member docs (GH-100054)
And add raw HTML fragments to keep old links working.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/structures.rst | 12 | ||||
-rw-r--r-- | Doc/c-api/type.rst | 19 |
2 files changed, 23 insertions, 8 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index aae1b95..7ce3578 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -395,7 +395,7 @@ Accessing attributes of extension types The string should be static, no copy is made of it. - .. c:member:: Py_ssize_t PyMemberDef.offset + .. c:member:: Py_ssize_t offset The offset in bytes that the member is located on the type’s object struct. @@ -625,23 +625,23 @@ Defining Getters and Setters Structure to define property-like access for a type. See also description of the :c:member:`PyTypeObject.tp_getset` slot. - .. c:member:: const char* PyGetSetDef.name + .. c:member:: const char* name attribute name - .. c:member:: getter PyGetSetDef.get + .. c:member:: getter get C function to get the attribute. - .. c:member:: setter PyGetSetDef.set + .. c:member:: setter set Optional C function to set or delete the attribute, if omitted the attribute is readonly. - .. c:member:: const char* PyGetSetDef.doc + .. c:member:: const char* doc optional docstring - .. c:member:: void* PyGetSetDef.closure + .. c:member:: void* closure Optional function pointer, providing additional data for getter and setter. diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index fb38935..89cd743 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -349,6 +349,15 @@ The following functions and structs are used to create :c:member:`~PyTypeObject.tp_new` is deprecated and in Python 3.14+ it will be no longer allowed. +.. raw:: html + + <!-- Keep old URL fragments working (see gh-97908) --> + <span id='c.PyType_Spec.PyType_Spec.name'></span> + <span id='c.PyType_Spec.PyType_Spec.basicsize'></span> + <span id='c.PyType_Spec.PyType_Spec.itemsize'></span> + <span id='c.PyType_Spec.PyType_Spec.flags'></span> + <span id='c.PyType_Spec.PyType_Spec.slots'></span> + .. c:type:: PyType_Spec Structure defining a type's behavior. @@ -410,12 +419,18 @@ The following functions and structs are used to create Each slot ID should be specified at most once. +.. raw:: html + + <!-- Keep old URL fragments working (see gh-97908) --> + <span id='c.PyType_Slot.PyType_Slot.slot'></span> + <span id='c.PyType_Slot.PyType_Slot.pfunc'></span> + .. c:type:: PyType_Slot Structure defining optional functionality of a type, containing a slot ID and a value pointer. - .. c:member:: int PyType_Slot.slot + .. c:member:: int slot A slot ID. @@ -459,7 +474,7 @@ The following functions and structs are used to create :c:member:`~PyBufferProcs.bf_releasebuffer` are now available under the limited API. - .. c:member:: void *PyType_Slot.pfunc + .. c:member:: void *pfunc The desired value of the slot. In most cases, this is a pointer to a function. |