From d2ec81a8c99796b51fb8c49b77a7fe369863226f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Feb 2020 09:17:07 +0100 Subject: bpo-39573: Add Py_SET_TYPE() function (GH-18394) Add Py_SET_TYPE() function to set the type of an object. --- Doc/c-api/structures.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Doc/c-api') diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index 100573c569..8a1431c2de 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -70,6 +70,13 @@ the definition of all other Python objects. (((PyObject*)(o))->ob_type) +.. c:function:: void Py_SET_TYPE(PyObject *o, PyTypeObject *type) + + Set the object *o* type to *type*. + + .. versionadded:: 3.9 + + .. c:macro:: Py_REFCNT(o) This macro is used to access the :attr:`ob_refcnt` member of a Python -- cgit v1.2.1