8000 [3.13] gh-106320: Document replacement for removed C API (GH-128787) … · python/cpython@d2a8d57 · GitHub
[go: up one dir, main page]

Skip to content

Commit d2a8d57

Browse files
[3.13] gh-106320: Document replacement for removed C API (GH-128787) (#128837)
gh-106320: Document replacement for removed C API (GH-128787) (cherry picked from commit 43ef958) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 0998eb6 commit d2a8d57

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,33 @@ Changes in the C API
27152715
Calling this function is redundant now that :c:func:`PyFrame_GetLocals`
27162716
returns a write-through proxy for :term:`optimized scopes <optimized scope>`.
27172717

2718+
* Python 3.13 removed many private functions. Some of them can be replaced using these
2719+
alternatives:
2720+
2721+
* ``_PyDict_Pop()``: :c:func:`PyDict_Pop` or :c:func:`PyDict_PopString`;
2722+
* ``_PyDict_GetItemWithError()``: :c:func:`PyDict_GetItemRef`;
2723+
* ``_PyErr_WriteUnraisableMsg()``: :c:func:`PyErr_FormatUnraisable`;
2724+
* ``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` or :c:func:`PyEval_SetTraceAllThreads`;
2725+
* ``_PyList_Extend()``: :c:func:`PyList_Extend`;
2726+
* ``_PyLong_AsInt()``: :c:func:`PyLong_AsInt`;
2727+
* ``_PyMem_RawStrdup()``: ``strdup()``;
2728+
* ``_PyMem_Strdup()``: ``strdup()``;
2729+
* ``_PyObject_ClearManagedDict()``: :c:func:`PyObject_ClearManagedDict`;
2730+
* ``_PyObject_VisitManagedDict()``: :c:func:`PyObject_VisitManagedDict`;
2731+
* ``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;
2732+
* ``_PyTime_AsSecondsDouble()``: :c:func:`PyTime_AsSecondsDouble`;
2733+
* ``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` or :c:func:`PyTime_MonotonicRaw`;
2734+
* ``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` or :c:func:`PyTime_PerfCounterRaw`;
2735+
* ``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` or :c:func:`PyTime_TimeRaw`;
2736+
* ``_PyTime_MAX``: :c:var:`PyTime_MAX`;
2737+
* ``_PyTime_MIN``: :c:var:`PyTime_MIN`;
2738+
* ``_PyTime_t``: :c:type:`PyTime_t`;
2739+
* ``_Py_HashPointer()``: :c:func:`Py_HashPointer`;
2740+
* ``_Py_IsFinalizing()``: :c:func:`Py_IsFinalizing`.
2741+
2742+
The `pythoncapi-compat project`_ can be used to get most of these new
2743+
functions on Python 3.12 and older.
2744+
27182745
Regression Test Changes
27192746
=======================
27202747

0 commit comments

Comments
 (0)
0