Skip to content

Commit 1c13b29

Browse files
chaenhugovk
andauthored
gh-120937: Reference weakref from the __del__ documentation (#120940)
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 22b0de2 commit 1c13b29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/reference/datamodel.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,8 @@ Basic customization
16671667

16681668
It is not guaranteed that :meth:`__del__` methods are called for objects
16691669
that still exist when the interpreter exits.
1670+
:class:`weakref.finalize` provides a straightforward way to register
1671+
a cleanup function to be called when an object is garbage collected.
16701672

16711673
.. note::
16721674

0 commit comments

Comments
 (0)