Skip to content

Commit 9de5901

Browse files
Document PyMember_GetOne and PyMember_SetOne (GH-27555)
(cherry picked from commit d382bde) Co-authored-by: Ken Jin <[email protected]>
1 parent 7c89bdd commit 9de5901

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: Doc/c-api/structures.rst

+15
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,21 @@ Accessing attributes of extension types
469469
{NULL} /* Sentinel */
470470
};
471471
472+
473+
.. c:function:: PyObject* PyMember_GetOne(const char *obj_addr, struct PyMemberDef *m)
474+
475+
Get an attribute belonging to the object at address *obj_addr*. The
476+
attribute is described by ``PyMemberDef`` *m*. Returns ``NULL``
477+
on error.
478+
479+
480+
.. c:function:: int PyMember_SetOne(char *obj_addr, struct PyMemberDef *m, PyObject *o)
481+
482+
Set an attribute belonging to the object at address *obj_addr* to object *o*.
483+
The attribute to set is described by ``PyMemberDef`` *m*. Returns ``0``
484+
if successful and a negative value on failure.
485+
486+
472487
.. c:type:: PyGetSetDef
473488
474489
Structure to define property-like access for a type. See also description of

0 commit comments

Comments
 (0)