diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index b78b38184f2c59..527eac6f62c4cf 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1664,6 +1664,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::