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

Skip to content

Commit b0d527c

Browse files
committed
Move C API removal to correct section
1 parent e130bfc commit b0d527c

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -920,42 +920,15 @@ webbrowser
920920
Others
921921
------
922922

923-
TODO
923+
* None yet
924924

925925
Porting to Python 3.13
926926
======================
927927

928928
This section lists previously described changes and other bugfixes
929929
that may require changes to your code.
930930

931-
* The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and ``Py_TRASHCAN_SAFE_END``
932-
were removed. They should be replaced by the new macros ``Py_TRASHCAN_BEGIN``
933-
and ``Py_TRASHCAN_END``.
934-
935-
A tp_dealloc function that has the old macros, such as::
936-
937-
static void
938-
mytype_dealloc(mytype *p)
939-
{
940-
PyObject_GC_UnTrack(p);
941-
Py_TRASHCAN_SAFE_BEGIN(p);
942-
...
943-
Py_TRASHCAN_SAFE_END
944-
}
945-
946-
should migrate to the new macros as follows::
947-
948-
static void
949-
mytype_dealloc(mytype *p)
950-
{
951-
PyObject_GC_UnTrack(p);
952-
Py_TRASHCAN_BEGIN(p, mytype_dealloc)
953-
...
954-
Py_TRASHCAN_END
955-
}
956-
957-
Note that ``Py_TRASHCAN_BEGIN`` has a second argument which
958-
should be the deallocation function it is in.
931+
* None yet
959932

960933

961934
Build Changes
@@ -1141,6 +1114,35 @@ Porting to Python 3.13
11411114
are now undefined by ``<Python.h>``.
11421115
(Contributed by Victor Stinner in :gh:`85283`.)
11431116

1117+
* The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and ``Py_TRASHCAN_SAFE_END``
1118+
were removed. They should be replaced by the new macros ``Py_TRASHCAN_BEGIN``
1119+
and ``Py_TRASHCAN_END``.
1120+
1121+
A tp_dealloc function that has the old macros, such as::
1122+
1123+
static void
1124+
mytype_dealloc(mytype *p)
1125+
{
1126+
PyObject_GC_UnTrack(p);
1127+
Py_TRASHCAN_SAFE_BEGIN(p);
1128+
...
1129+
Py_TRASHCAN_SAFE_END
1130+
}
1131+
1132+
should migrate to the new macros as follows::
1133+
1134+
static void
1135+
mytype_dealloc(mytype *p)
1136+
{
1137+
PyObject_GC_UnTrack(p);
1138+
Py_TRASHCAN_BEGIN(p, mytype_dealloc)
1139+
...
1140+
Py_TRASHCAN_END
1141+
}
1142+
1143+
Note that ``Py_TRASHCAN_BEGIN`` has a second argument which
1144+
should be the deallocation function it is in.
1145+
11441146
Deprecated
11451147
----------
11461148

0 commit comments

Comments
 (0)