]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document PyMember_GetOne and PyMember_SetOne (GH-27555) (GH-27561)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Aug 2021 16:53:55 +0000 (09:53 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Aug 2021 16:53:55 +0000 (18:53 +0200)
(cherry picked from commit d382bde220b4c07cce2b924ffeb7525ea1a969f4)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Doc/c-api/structures.rst

index 0a0e03ff77ce64b0fa4ebf8c3625444303fb37bd..1e30d408ab6d1b347e312809a491573a768b4963 100644 (file)
@@ -436,6 +436,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