summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-08-02 17:08:49 (GMT)
committerGitHub <noreply@github.com>2021-08-02 17:08:49 (GMT)
commit9de590151d49f2988d3a5c4d30b9daf86616f6f3 (patch)
tree0ae0b8539212f16c1d0b89405e18140eb904595c /Doc/c-api
parent7c89bddd2f7d2fa8ff82782caccdc9706f804313 (diff)
downloadcpython-9de590151d49f2988d3a5c4d30b9daf86616f6f3.zip
cpython-9de590151d49f2988d3a5c4d30b9daf86616f6f3.tar.gz
cpython-9de590151d49f2988d3a5c4d30b9daf86616f6f3.tar.bz2
Document PyMember_GetOne and PyMember_SetOne (GH-27555)
(cherry picked from commit d382bde220b4c07cce2b924ffeb7525ea1a969f4) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/structures.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 20d5485..05c54cc 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -469,6 +469,21 @@ Accessing attributes of extension types
{NULL} /* Sentinel */
};
+
+.. c:function:: PyObject* PyMember_GetOne(const char *obj_addr, struct PyMemberDef *m)
+
+ Get an attribute belonging to the object at address *obj_addr*. The
+ attribute is described by ``PyMemberDef`` *m*. Returns ``NULL``
+ on error.
+
+
+.. c:function:: int PyMember_SetOne(char *obj_addr, struct PyMemberDef *m, PyObject *o)
+
+ Set an attribute belonging to the object at address *obj_addr* to object *o*.
+ The attribute to set is described by ``PyMemberDef`` *m*. Returns ``0``
+ if successful and a negative value on failure.
+
+
.. c:type:: PyGetSetDef
Structure to define property-like access for a type. See also description of