Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cf7ca6

Browse files
committed
Move C API removal to correct section
1 parent cda6b77 commit 8cf7ca6

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -936,47 +936,15 @@ webbrowser
936936
Others
937937
------
938938

939-
* Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and
940-
``Py_TRASHCAN_SAFE_END``. They should be replaced by the new macros
941-
``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``. The new macros were
942-
added in Python 3.8 and the old macros were deprecated in Python 3.11.
943-
(Contributed by Irit Katriel in :gh:`105111`.)
944-
939+
* None yet
945940

946941
Porting to Python 3.13
947942
======================
948943

949944
This section lists previously described changes and other bugfixes
950945
that may require changes to your code.
951946

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

981949

982950
Build Changes
@@ -1172,6 +1140,35 @@ Porting to Python 3.13
11721140
are now undefined by ``<Python.h>``.
11731141
(Contributed by Victor Stinner in :gh:`85283`.)
11741142

1143+
* The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and ``Py_TRASHCAN_SAFE_END``
1144+
were removed. They should be replaced by the new macros ``Py_TRASHCAN_BEGIN``
1145+
and ``Py_TRASHCAN_END``.
1146+
1147+
A tp_dealloc function that has the old macros, such as::
1148+
1149+
static void
1150+
mytype_dealloc(mytype *p)
1151+
{
1152+
PyObject_GC_UnTrack(p);
1153+
Py_TRASHCAN_SAFE_BEGIN(p);
1154+
...
1155+
Py_TRASHCAN_SAFE_END
1156+
}
1157+
1158+
should migrate to the new macros as follows::
1159+
1160+
static void
1161+
mytype_dealloc(mytype *p)
1162+
{
1163+
PyObject_GC_UnTrack(p);
1164+
Py_TRASHCAN_BEGIN(p, mytype_dealloc)
1165+
...
1166+
Py_TRASHCAN_END
1167+
}
1168+
1169+
Note that ``Py_TRASHCAN_BEGIN`` has a second argument which
1170+
should be the deallocation function it is in.
1171+
11751172
* The :c:func:`PyUnicode_AsUTF8` function now raises an exception if the string
11761173
contains embedded null characters. To accept embedded null characters and
11771174
truncate on purpose at the first null byte,
@@ -1306,6 +1303,12 @@ Removed
13061303
Configuration <init-config>` instead (:pep:`587`), added to Python 3.8.
13071304
(Contributed by Victor Stinner in :gh:`105145`.)
13081305

1306+
* Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and
1307+
``Py_TRASHCAN_SAFE_END``. They should be replaced by the new macros
1308+
``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``. The new macros were
1309+
added in Python 3.8 and the old macros were deprecated in Python 3.11.
1310+
(Contributed by Irit Katriel in :gh:`105111`.)
1311+
13091312
* Remove ``PyEval_InitThreads()`` and ``PyEval_ThreadsInitialized()``
13101313
functions, deprecated in Python 3.9. Since Python 3.7, ``Py_Initialize()``
13111314
always creates the GIL: calling ``PyEval_InitThreads()`` did nothing and

0 commit comments

Comments
 (0)