Doc: Update Py_TPFLAGS_HAVE_FINALIZE in docs (GH-96273)

It is now deprecated and the docs should reflect that.
(cherry picked from commit 9625de6fab)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
This commit is contained in:
Miss Islington (bot) 2022-08-30 01:38:53 -07:00 committed by GitHub
parent af9fbec27e
commit e89f8b0ae4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1990,9 +1990,6 @@ and :c:type:`PyType_Type` effectively act as defaults.)
PyErr_Restore(error_type, error_value, error_traceback);
}
For this field to be taken into account (even through inheritance),
you must also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit.
Also, note that, in a garbage collected Python,
:c:member:`~PyTypeObject.tp_dealloc` may be called from
any Python thread, not just the thread which created the object (if the object
@ -2010,6 +2007,12 @@ and :c:type:`PyType_Type` effectively act as defaults.)
.. versionadded:: 3.4
.. versionchanged:: 3.8
Before version 3.8 it was necessary to set the
:const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be
used. This is no longer required.
.. seealso:: "Safe object finalization" (:pep:`442`)