Skip to content

Commit ffafa4d

Browse files
committed
pythongh-120937: Reference weakref from the __del__ documentation
The weakref documentation refers to __del__, but not the other way around.
1 parent fc297b4 commit ffafa4d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎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 straight forward 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)