| 1 |
Pending removal in Python 3.18 |
| 2 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 3 |
|
| 4 |
* The following private functions are deprecated |
| 5 |
and planned for removal in Python 3.18: |
| 6 |
|
| 7 |
* :c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`. |
| 8 |
* :c:func:`!_PyDict_GetItemStringWithError`: use :c:func:`PyDict_GetItemStringRef`. |
| 9 |
* :c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`. |
| 10 |
* :c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`. |
| 11 |
* :c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: |
| 12 |
use :c:func:`PyLongWriter_Create`. |
| 13 |
* :c:func:`!_PyThreadState_UncheckedGet`: use :c:func:`PyThreadState_GetUnchecked`. |
| 14 |
* :c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`. |
| 15 |
* :c:func:`!_PyUnicodeWriter_Init`: |
| 16 |
replace ``_PyUnicodeWriter_Init(&writer)`` with |
| 17 |
:c:func:`writer = PyUnicodeWriter_Create(0) <PyUnicodeWriter_Create>`. |
| 18 |
* :c:func:`!_PyUnicodeWriter_Finish`: |
| 19 |
replace ``_PyUnicodeWriter_Finish(&writer)`` with |
| 20 |
:c:func:`PyUnicodeWriter_Finish(writer) <PyUnicodeWriter_Finish>`. |
| 21 |
* :c:func:`!_PyUnicodeWriter_Dealloc`: |
| 22 |
replace ``_PyUnicodeWriter_Dealloc(&writer)`` with |
| 23 |
:c:func:`PyUnicodeWriter_Discard(writer) <PyUnicodeWriter_Discard>`. |
| 24 |
* :c:func:`!_PyUnicodeWriter_WriteChar`: |
| 25 |
replace ``_PyUnicodeWriter_WriteChar(&writer, ch)`` with |
| 26 |
:c:func:`PyUnicodeWriter_WriteChar(writer, ch) <PyUnicodeWriter_WriteChar>`. |
| 27 |
* :c:func:`!_PyUnicodeWriter_WriteStr`: |
| 28 |
replace ``_PyUnicodeWriter_WriteStr(&writer, str)`` with |
| 29 |
:c:func:`PyUnicodeWriter_WriteStr(writer, str) <PyUnicodeWriter_WriteStr>`. |
| 30 |
* :c:func:`!_PyUnicodeWriter_WriteSubstring`: |
| 31 |
replace ``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with |
| 32 |
:c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) <PyUnicodeWriter_WriteSubstring>`. |
| 33 |
* :c:func:`!_PyUnicodeWriter_WriteASCIIString`: |
| 34 |
replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with |
| 35 |
:c:func:`PyUnicodeWriter_WriteASCII(writer, str) <PyUnicodeWriter_WriteASCII>`. |
| 36 |
* :c:func:`!_PyUnicodeWriter_WriteLatin1String`: |
| 37 |
replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with |
| 38 |
:c:func:`PyUnicodeWriter_WriteUTF8(writer, str) <PyUnicodeWriter_WriteUTF8>`. |
| 39 |
* :c:func:`!_PyUnicodeWriter_Prepare`: (no replacement). |
| 40 |
* :c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement). |
| 41 |
* :c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`. |
| 42 |
* :c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`. |
| 43 |
|
| 44 |
The `pythoncapi-compat project |
| 45 |
<https://github.com/python/pythoncapi-compat/>`__ can be used to get |
| 46 |
these new public functions on Python 3.13 and older. |
| 47 |
(Contributed by Victor Stinner in :gh:`128863`.) |