Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1200,20 +1200,6 @@ and :c:data:`PyType_Type` effectively act as defaults.)
set appropriately, or the code that interacts with such types
will behave differently depending on what kind of check is used.


.. c:macro:: Py_TPFLAGS_HAVE_FINALIZE

This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is present in the
type structure.

.. versionadded:: 3.4

.. deprecated:: 3.8
This flag isn't necessary anymore, as the interpreter assumes the
:c:member:`~PyTypeObject.tp_finalize` slot is always present in the
type structure.


.. c:macro:: Py_TPFLAGS_HAVE_VECTORCALL

This bit is set when the class implements
Expand Down Expand Up @@ -2126,12 +2112,6 @@ and :c:data:`PyType_Type` effectively act as defaults.)

.. versionadded:: 3.4

.. versionchanged:: 3.8

Before version 3.8 it was necessary to set the
:c:macro:`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`)


Expand Down
1 change: 0 additions & 1 deletion Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ given type object has a specified feature.
* Note that older extensions using the stable ABI set these flags,
* so the bits must not be repurposed.
*/
#define Py_TPFLAGS_HAVE_FINALIZE (1UL << 0)
#define Py_TPFLAGS_HAVE_VERSION_TAG (1UL << 18)


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove :c:macro:`Py_TPFLAGS_HAVE_FINALIZE` macro.
2 changes: 1 addition & 1 deletion Modules/_testcapi/heaptype.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ static PyType_Spec HeapCTypeSubclassWithFinalizer_spec = {
"_testcapi.HeapCTypeSubclassWithFinalizer",
sizeof(HeapCTypeSubclassObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_FINALIZE,
Py_TPFLAGS_DEFAULT,
HeapCTypeSubclassWithFinalizer_slots
};

Expand Down
2 changes: 1 addition & 1 deletion Modules/_testmultiphase.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static PyType_Spec StateAccessType_spec = {
"_testimportexec.StateAccessType",
sizeof(StateAccessTypeObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_FINALIZE | Py_TPFLAGS_BASETYPE,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
StateAccessType_Type_slots
};

Expand Down
3 changes: 1 addition & 2 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -16325,8 +16325,7 @@ static PyType_Spec ScandirIteratorType_spec = {
0,
// bpo-40549: Py_TPFLAGS_BASETYPE should not be used, since
// PyType_GetModule(Py_TYPE(self)) doesn't work on a subclass instance.
(Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_FINALIZE
| Py_TPFLAGS_DISALLOW_INSTANTIATION),
(Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION),
ScandirIteratorType_slots
};

Expand Down
Loading