summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2020-02-13 17:37:17 (GMT)
committerGitHub <noreply@github.com>2020-02-13 17:37:17 (GMT)
commitd905df766c367c350f20c46ccd99d4da19ed57d8 (patch)
tree9e08a6c88d6b0dd4e73810c3f3a152b61bd773aa /Doc
parent968dcd9e7a4d3aa9aaa1dfca693adf60d6b71ce7 (diff)
downloadcpython-d905df766c367c350f20c46ccd99d4da19ed57d8.zip
cpython-d905df766c367c350f20c46ccd99d4da19ed57d8.tar.gz
cpython-d905df766c367c350f20c46ccd99d4da19ed57d8.tar.bz2
bpo-39573: Add Py_IS_TYPE() function (GH-18488)
Co-Author: Neil Schemenauer <nas-github@arctrix.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/structures.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 083c374..fc3467b 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -70,6 +70,14 @@ the definition of all other Python objects.
(((PyObject*)(o))->ob_type)
+.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
+
+ Return non-zero if the object *o* type is *type*. Return zero otherwise.
+ Equivalent to: ``Py_TYPE(o) == type``.
+
+ .. versionadded:: 3.9
+
+
.. c:function:: void Py_SET_TYPE(PyObject *o, PyTypeObject *type)
Set the object *o* type to *type*.