https://github.com/python/cpython/commit/709ef004dffe9cee2a023a3c8032d4ce80513582 commit: 709ef004dffe9cee2a023a3c8032d4ce80513582 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: sobolevn <[email protected]> date: 2024-06-26T20:14:30Z summary:
[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 1c13b29d54ad6d7c9e030227d575ad7d21b4054f) Co-authored-by: chaen <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 602014deebaa7b..16edb675f02d03 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1643,6 +1643,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:: _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
