summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchaen <christophe.haen@cern.ch>2024-06-26 20:07:09 (GMT)
committerGitHub <noreply@github.com>2024-06-26 20:07:09 (GMT)
commit1c13b29d54ad6d7c9e030227d575ad7d21b4054f (patch)
tree83bd246f085347cf1cab2c64ba3d775e75cb7490
parent22b0de2755ee2d0e2dd21cd8761f15421ed2da3d (diff)
downloadcpython-1c13b29d54ad6d7c9e030227d575ad7d21b4054f.zip
cpython-1c13b29d54ad6d7c9e030227d575ad7d21b4054f.tar.gz
cpython-1c13b29d54ad6d7c9e030227d575ad7d21b4054f.tar.bz2
gh-120937: Reference weakref from the `__del__` documentation (#120940)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
-rw-r--r--Doc/reference/datamodel.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index af4c585..34d8bbe 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1667,6 +1667,8 @@ Basic customization
It is not guaranteed that :meth:`__del__` methods are called for objects
that still exist when the interpreter exits.
+ :class:`weakref.finalize` provides a straightforward way to register
+ a cleanup function to be called when an object is garbage collected.
.. note::