Document PyMember_GetOne and PyMember_SetOne (GH-27555) (GH-27561)

(cherry picked from commit d382bde220)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2021-08-02 09:53:55 -07:00 committed by GitHub
parent 0f6a7739df
commit 77a96da556
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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