summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/weakref.rst
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2023-03-25 07:44:05 (GMT)
committerGitHub <noreply@github.com>2023-03-25 07:44:05 (GMT)
commit7513c6b6fe50dd651abe4d9b0c2f207b032cabfe (patch)
tree09678fd549bb383ce7ba5699067f37e3ed3aa1c5 /Doc/c-api/weakref.rst
parentd3b4d3ace9db1b673d69737c740d56ab6da824b0 (diff)
downloadcpython-7513c6b6fe50dd651abe4d9b0c2f207b032cabfe.zip
cpython-7513c6b6fe50dd651abe4d9b0c2f207b032cabfe.tar.gz
cpython-7513c6b6fe50dd651abe4d9b0c2f207b032cabfe.tar.bz2
[3.10] gh-101100: Document PyObject_ClearWeakRefs and gzip's name (#103002)
Diffstat (limited to 'Doc/c-api/weakref.rst')
-rw-r--r--Doc/c-api/weakref.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/c-api/weakref.rst b/Doc/c-api/weakref.rst
index cb6aba3..b471260 100644
--- a/Doc/c-api/weakref.rst
+++ b/Doc/c-api/weakref.rst
@@ -68,3 +68,13 @@ as much as it can.
Similar to :c:func:`PyWeakref_GetObject`, but implemented as a macro that does no
error checking.
+
+
+.. c:function:: void PyObject_ClearWeakRefs(PyObject *object)
+
+ This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler
+ to clear weak references.
+
+ This iterates through the weak references for *object* and calls callbacks
+ for those references which have one. It returns when all callbacks have
+ been attempted.