Skip to content

Commit 709ef00

Browse files
miss-islingtonchaenhugovk
authored
[3.12] gh-120937: Reference weakref from the __del__ documentation (GH-120940) (#121062)
gh-120937: Reference weakref from the `__del__` documentation (GH-120940) (cherry picked from commit 1c13b29) Co-authored-by: chaen <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 4868d1b commit 709ef00

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
@@ -1643,6 +1643,8 @@ Basic customization
16431643

16441644
It is not guaranteed that :meth:`__del__` methods are called for objects
16451645
that still exist when the interpreter exits.
1646+
:class:`weakref.finalize` provides a straightforward way to register
1647+
a cleanup function to be called when an object is garbage collected.
16461648

16471649
.. note::
16481650

0 commit comments

Comments
 (0)