Skip to content

Commit 6cdba18

Browse files
committed
Move C API removal to correct section
1 parent 010a259 commit 6cdba18

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

Doc/whatsnew/3.13.rst

+31-29
Original file line numberDiff line numberDiff line change
@@ -935,42 +935,15 @@ webbrowser
935935
Others
936936
------
937937

938-
TODO
938+
* None yet
939939

940940
Porting to Python 3.13
941941
======================
942942

943943
This section lists previously described changes and other bugfixes
944944
that may require changes to your code.
945945

946-
* The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and ``Py_TRASHCAN_SAFE_END``
947-
were removed. They should be replaced by the new macros ``Py_TRASHCAN_BEGIN``
948-
and ``Py_TRASHCAN_END``.
949-
950-
A tp_dealloc function that has the old macros, such as::
951-
952-
static void
953-
mytype_dealloc(mytype *p)
954-
{
955-
PyObject_GC_UnTrack(p);
956-
Py_TRASHCAN_SAFE_BEGIN(p);
957-
...
958-
Py_TRASHCAN_SAFE_END
959-
}
960-
961-
should migrate to the new macros as follows::
962-
963-
static void
964-
mytype_dealloc(mytype *p)
965-
{
966-
PyObject_GC_UnTrack(p);
967-
Py_TRASHCAN_BEGIN(p, mytype_dealloc)
968-
...
969-
Py_TRASHCAN_END
970-
}
971-
972-
Note that ``Py_TRASHCAN_BEGIN`` has a second argument which
973-
should be the deallocation function it is in.
946+
* None yet
974947

975948

976949
Build Changes
@@ -1166,6 +1139,35 @@ Porting to Python 3.13
11661139
are now undefined by ``<Python.h>``.
11671140
(Contributed by Victor Stinner in :gh:`85283`.)
11681141

1142+
* The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and ``Py_TRASHCAN_SAFE_END``
1143+
were removed. They should be replaced by the new macros ``Py_TRASHCAN_BEGIN``
1144+
and ``Py_TRASHCAN_END``.
1145+
1146+
A tp_dealloc function that has the old macros, such as::
1147+
1148+
static void
1149+
mytype_dealloc(mytype *p)
1150+
{
1151+
PyObject_GC_UnTrack(p);
1152+
Py_TRASHCAN_SAFE_BEGIN(p);
1153+
...
1154+
Py_TRASHCAN_SAFE_END
1155+
}
1156+
1157+
should migrate to the new macros as follows::
1158+
1159+
static void
1160+
mytype_dealloc(mytype *p)
1161+
{
1162+
PyObject_GC_UnTrack(p);
1163+
Py_TRASHCAN_BEGIN(p, mytype_dealloc)
1164+
...
1165+
Py_TRASHCAN_END
1166+
}
1167+
1168+
Note that ``Py_TRASHCAN_BEGIN`` has a second argument which
1169+
should be the deallocation function it is in.
1170+
11691171
* The :c:func:`PyUnicode_AsUTF8` function now raises an exception if the string
11701172
contains embedded null characters. To accept embedded null characters and
11711173
truncate on purpose at the first null byte,

0 commit comments

Comments
 (0)