]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-120937: Reference weakref from the `__del__` documentation (GH-120940)...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 26 Jun 2024 20:24:25 +0000 (22:24 +0200)
committerGitHub <noreply@github.com>
Wed, 26 Jun 2024 20:24:25 +0000 (20:24 +0000)
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>
Doc/reference/datamodel.rst

index b78b38184f2c59c9d5b46534535e46603c8d0cb9..527eac6f62c4cf76bbd59cbcfb8890dbee934b34 100644 (file)
@@ -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::