[Python-checkins] Document PyMember_GetOne and PyMember_SetOne (GH-27555)
ambv
webhook-mailer at python.org
Mon Aug 2 12:27:07 EDT 2021
https://github.com/python/cpython/commit/d382bde220b4c07cce2b924ffeb7525ea1a969f4
commit: d382bde220b4c07cce2b924ffeb7525ea1a969f4
branch: main
author: Ken Jin <28750310+Fidget-Spinner at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2021-08-02T18:26:57+02:00
summary:
Document PyMember_GetOne and PyMember_SetOne (GH-27555)
files:
M Doc/c-api/structures.rst
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 20d5485d5544c..05c54ccc8dab5 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
More information about the Python-checkins
mailing list