Skip to content

Commit 1c13b29

Browse files
chaenhugovk
andauthored
pythongh-120937: Reference weakref from the __del__ documentation (python#120940)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
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

+2
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)