]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-120937: Reference weakref from the `__del__` documentation (#120940)
authorchaen <christophe.haen@cern.ch>
Wed, 26 Jun 2024 20:07:09 +0000 (22:07 +0200)
committerGitHub <noreply@github.com>
Wed, 26 Jun 2024 20:07:09 +0000 (23:07 +0300)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc/reference/datamodel.rst

index af4c585e1c3e2f84d1dc71f6d687b983cf2d4e3f..34d8bbee4c680618ace48a48d7d94ac069859659 100644 (file)
@@ -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::