From 0e59aedb6c620fd02bf0c349c878cb0817a62172 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Fri, 23 Oct 2026 15:45:55 -0700 Subject: [PATCH] gh-154757: Unschedule removal of Py_UNICODE (and Py_UNICODE_TYPE) PEP-387 says (and did say back when these types were deprecated in 3.13): > If the expected maintenance overhead and security risk of the > deprecated behavior is small (e.g. an old function is > reimplemented in terms of a new, more general one), > it can stay indefinitely (or until the situation changes). There's no need to remove these. --- Doc/c-api/unicode.rst | 7 ++++--- Doc/deprecations/c-api-pending-removal-in-3.16.rst | 2 -- Doc/whatsnew/3.16.rst | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 8db6ef22b00d15..ec87ef43bcd3b6 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -1865,9 +1865,10 @@ Deprecated API The following API is deprecated. .. c:type:: Py_UNICODE + Py_UNICODE_TYPE - This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit type - depending on the platform. + These are both typedefs of :c:type:`wchar_t`, which is a 16-bit type + or 32-bit type depending on the platform. Please use :c:type:`wchar_t` directly instead. .. versionchanged:: 3.3 @@ -1875,7 +1876,7 @@ The following API is deprecated. whether you selected a "narrow" or "wide" Unicode version of Python at build time. - .. deprecated-removed:: 3.13 3.16 + .. deprecated:: 3.13 .. c:function:: int PyUnicode_READY(PyObject *unicode) diff --git a/Doc/deprecations/c-api-pending-removal-in-3.16.rst b/Doc/deprecations/c-api-pending-removal-in-3.16.rst index dd840fac9b151b..aec27d11655a82 100644 --- a/Doc/deprecations/c-api-pending-removal-in-3.16.rst +++ b/Doc/deprecations/c-api-pending-removal-in-3.16.rst @@ -83,5 +83,3 @@ Pending removal in Python 3.16 The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to get these options at runtime. - -* :c:type:`Py_UNICODE` which was deprecated by :pep:`393`. diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index 5e1821dbc8d2cd..05786bc9114733 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -1386,6 +1386,9 @@ Deprecated C APIs Use the safer :c:type:`PyUnicodeWriter` API instead. (Contributed by Victor Stinner in :gh:`157710`.) +* :c:type:`Py_UNICODE` and :c:type:`Py_UNICODE_TYPE` are deprecated, but + no longer scheduled for removal. + .. Add C API deprecations above alphabetically, not here at the end. .. include:: ../deprecations/c-api-pending-removal-in-3.18.rst