https://github.com/python/cpython/commit/d2a8d57123676fe45c8268c461bbe8922a07b015
commit: d2a8d57123676fe45c8268c461bbe8922a07b015
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2025-01-14T15:42:30Z
summary:

[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 43ef9587ae869fd11711a3bb126e65afe9177342)

Co-authored-by: Victor Stinner <[email protected]>

files:
M Doc/whatsnew/3.13.rst

diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index dfc4a98ff82c4b..ea54e1c94c8b0e 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -2715,6 +2715,33 @@ Changes in the C API
     Calling this function is redundant now that :c:func:`PyFrame_GetLocals`
     returns a write-through proxy for :term:`optimized scopes <optimized 
scope>`.
 
+* Python 3.13 removed many private functions. Some of them can be replaced 
using these
+  alternatives:
+
+  * ``_PyDict_Pop()``: :c:func:`PyDict_Pop` or :c:func:`PyDict_PopString`;
+  * ``_PyDict_GetItemWithError()``: :c:func:`PyDict_GetItemRef`;
+  * ``_PyErr_WriteUnraisableMsg()``:  :c:func:`PyErr_FormatUnraisable`;
+  * ``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` or 
:c:func:`PyEval_SetTraceAllThreads`;
+  * ``_PyList_Extend()``: :c:func:`PyList_Extend`;
+  * ``_PyLong_AsInt()``: :c:func:`PyLong_AsInt`;
+  * ``_PyMem_RawStrdup()``: ``strdup()``;
+  * ``_PyMem_Strdup()``: ``strdup()``;
+  * ``_PyObject_ClearManagedDict()``: :c:func:`PyObject_ClearManagedDict`;
+  * ``_PyObject_VisitManagedDict()``: :c:func:`PyObject_VisitManagedDict`;
+  * ``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;
+  * ``_PyTime_AsSecondsDouble()``: :c:func:`PyTime_AsSecondsDouble`;
+  * ``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` or 
:c:func:`PyTime_MonotonicRaw`;
+  * ``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` or 
:c:func:`PyTime_PerfCounterRaw`;
+  * ``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` or 
:c:func:`PyTime_TimeRaw`;
+  * ``_PyTime_MAX``: :c:var:`PyTime_MAX`;
+  * ``_PyTime_MIN``: :c:var:`PyTime_MIN`;
+  * ``_PyTime_t``: :c:type:`PyTime_t`;
+  * ``_Py_HashPointer()``: :c:func:`Py_HashPointer`;
+  * ``_Py_IsFinalizing()``: :c:func:`Py_IsFinalizing`.
+
+  The `pythoncapi-compat project`_ can be used to get most of these new
+  functions on Python 3.12 and older.
+
 Regression Test Changes
 =======================
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to