summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-26 20:24:25 (GMT)
committerGitHub <noreply@github.com>2024-06-26 20:24:25 (GMT)
commitd7cd71c72a9ad0abcc89deed50762ac7ceaef6d4 (patch)
tree8339246c589ebdb836a563e132b61972946463e7
parent38cfa92880a19d03a4ada4cd843870a8602c13a0 (diff)
downloadcpython-d7cd71c72a9ad0abcc89deed50762ac7ceaef6d4.zip
cpython-d7cd71c72a9ad0abcc89deed50762ac7ceaef6d4.tar.gz
cpython-d7cd71c72a9ad0abcc89deed50762ac7ceaef6d4.tar.bz2
[3.13] gh-120937: Reference weakref from the `__del__` documentation (GH-120940) (#121061)
gh-120937: Reference weakref from the `__del__` documentation (GH-120940) (cherry picked from commit 1c13b29d54ad6d7c9e030227d575ad7d21b4054f) Co-authored-by: chaen <christophe.haen@cern.ch> 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 b78b381..527eac6 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -1664,6 +1664,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::