summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-04-14 18:11:20 (GMT)
committerGitHub <noreply@github.com>2020-04-14 18:11:20 (GMT)
commit675d9a3d7afc767a2818c84da7ba4bf4181dcf26 (patch)
tree621da3f9078df542c36e8bb856c6d86da4ce52b0 /Doc
parenta5900ecf9f22e65bef489633692e9ea6941379c5 (diff)
downloadcpython-675d9a3d7afc767a2818c84da7ba4bf4181dcf26.zip
cpython-675d9a3d7afc767a2818c84da7ba4bf4181dcf26.tar.gz
cpython-675d9a3d7afc767a2818c84da7ba4bf4181dcf26.tar.bz2
bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/gcsupport.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/c-api/gcsupport.rst b/Doc/c-api/gcsupport.rst
index 4cab0f5..eee114c 100644
--- a/Doc/c-api/gcsupport.rst
+++ b/Doc/c-api/gcsupport.rst
@@ -60,6 +60,15 @@ Constructors for container types must conform to two rules:
followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, usually near the
end of the constructor.
+
+.. c:function:: int PyObject_IS_GC(PyObject *obj)
+
+ Returns non-zero if the object implements the garbage collector protocol,
+ otherwise returns 0.
+
+ The object cannot be tracked by the garbage collector if this function returns 0.
+
+
.. c:function:: int PyObject_GC_IsTracked(PyObject *op)
Returns 1 if the object type of *op* implements the GC protocol and *op* is being