summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 08:17:07 (GMT)
committerGitHub <noreply@github.com>2020-02-07 08:17:07 (GMT)
commitd2ec81a8c99796b51fb8c49b77a7fe369863226f (patch)
treed88e7cbe89f65366d5591338fbe59a71192950db /Doc/c-api
parentdaa9756cb6395323d6f291efe5c7d7fdc6b2e9d8 (diff)
downloadcpython-d2ec81a8c99796b51fb8c49b77a7fe369863226f.zip
cpython-d2ec81a8c99796b51fb8c49b77a7fe369863226f.tar.gz
cpython-d2ec81a8c99796b51fb8c49b77a7fe369863226f.tar.bz2
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/structures.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 100573c..8a1431c 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