bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464)

This commit is contained in:
Hai Shi 2020-04-15 02:11:20 +08:00 committed by GitHub
parent a5900ecf9f
commit 675d9a3d7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 15 deletions

View file

@ -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