Skip to content

Commit 0e59aed

Browse files
committed
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.
1 parent 2258026 commit 0e59aed

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎Doc/c-api/unicode.rst‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,17 +1865,18 @@ Deprecated API
18651865
The following API is deprecated.
18661866
18671867
.. c:type:: Py_UNICODE
1868+
Py_UNICODE_TYPE
18681869
1869-
This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit type
1870-
depending on the platform.
1870+
These are both typedefs of :c:type:`wchar_t`, which is a 16-bit type
1871+
or 32-bit type depending on the platform.
18711872
Please use :c:type:`wchar_t` directly instead.
18721873
18731874
.. versionchanged:: 3.3
18741875
In previous versions, this was a 16-bit type or a 32-bit type depending on
18751876
whether you selected a "narrow" or "wide" Unicode version of Python at
18761877
build time.
18771878
1878-
.. deprecated-removed:: 3.13 3.16
1879+
.. deprecated:: 3.13
18791880
18801881
18811882
.. c:function:: int PyUnicode_READY(PyObject *unicode)

‎Doc/deprecations/c-api-pending-removal-in-3.16.rst‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,3 @@ Pending removal in Python 3.16
8383
The :c:func:`Py_InitializeFromConfig` API should be used with
8484
:c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be
8585
used to get these options at runtime.
86-
87-
* :c:type:`Py_UNICODE` which was deprecated by :pep:`393`.

‎Doc/whatsnew/3.16.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,9 @@ Deprecated C APIs
13861386
Use the safer :c:type:`PyUnicodeWriter` API instead.
13871387
(Contributed by Victor Stinner in :gh:`157710`.)
13881388

1389+
* :c:type:`Py_UNICODE` and :c:type:`Py_UNICODE_TYPE` are deprecated, but
1390+
no longer scheduled for removal.
1391+
13891392
.. Add C API deprecations above alphabetically, not here at the end.
13901393
13911394
.. include:: ../deprecations/c-api-pending-removal-in-3.18.rst

0 commit comments

Comments
 (0)