Skip to content

Commit d7cd71c

Browse files
miss-islingtonchaenhugovk
authored
[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 1c13b29) Co-authored-by: chaen <christophe.haen@cern.ch> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 38cfa92 commit d7cd71c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/reference/datamodel.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,8 @@ Basic customization
16641664

16651665
It is not guaranteed that :meth:`__del__` methods are called for objects
16661666
that still exist when the interpreter exits.
1667+
:class:`weakref.finalize` provides a straightforward way to register
1668+
a cleanup function to be called when an object is garbage collected.
16671669

16681670
.. note::
16691671

0 commit comments

Comments
 (0)