Skip to content

Commit 346afeb

Browse files
bpo-36346: Document removal schedule of deprecate APIs (GH-20879) (#24626)
We will remove wstr cache in Python 3.12. See PEP 623. (cherry picked from commit 2d6f2ee) Co-authored-by: Inada Naoki <[email protected]> Co-authored-by: Inada Naoki <[email protected]>
1 parent 07ab490 commit 346afeb

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Doc/c-api/arg.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ which disallows mutable objects such as :class:`bytearray`.
151151
Previously, :exc:`TypeError` was raised when embedded null code points
152152
were encountered in the Python string.
153153

154-
.. deprecated-removed:: 3.3 4.0
154+
.. deprecated-removed:: 3.3 3.12
155155
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
156156
:c:func:`PyUnicode_AsWideCharString`.
157157

@@ -160,23 +160,23 @@ which disallows mutable objects such as :class:`bytearray`.
160160
Unicode data buffer, the second one its length. This variant allows
161161
null code points.
162162

163-
.. deprecated-removed:: 3.3 4.0
163+
.. deprecated-removed:: 3.3 3.12
164164
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
165165
:c:func:`PyUnicode_AsWideCharString`.
166166

167167
``Z`` (:class:`str` or ``None``) [const Py_UNICODE \*]
168168
Like ``u``, but the Python object may also be ``None``, in which case the
169169
:c:type:`Py_UNICODE` pointer is set to ``NULL``.
170170

171-
.. deprecated-removed:: 3.3 4.0
171+
.. deprecated-removed:: 3.3 3.12
172172
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
173173
:c:func:`PyUnicode_AsWideCharString`.
174174

175175
``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \*, int or :c:type:`Py_ssize_t`]
176176
Like ``u#``, but the Python object may also be ``None``, in which case the
177177
:c:type:`Py_UNICODE` pointer is set to ``NULL``.
178178

179-
.. deprecated-removed:: 3.3 4.0
179+
.. deprecated-removed:: 3.3 3.12
180180
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
181181
:c:func:`PyUnicode_AsWideCharString`.
182182

Doc/c-api/unicode.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ points must be below 1114112 (which is the full Unicode range).
1919

2020
:c:type:`Py_UNICODE*` and UTF-8 representations are created on demand and cached
2121
in the Unicode object. The :c:type:`Py_UNICODE*` representation is deprecated
22-
and inefficient; it should be avoided in performance- or memory-sensitive
23-
situations.
22+
and inefficient.
2423

2524
Due to the transition between the old APIs and the new APIs, Unicode objects
2625
can internally be in two states depending on how they were created:
@@ -429,7 +428,7 @@ APIs:
429428
430429
If *u* is ``NULL``, this function behaves like :c:func:`PyUnicode_FromUnicode`
431430
with the buffer set to ``NULL``. This usage is deprecated in favor of
432-
:c:func:`PyUnicode_New`.
431+
:c:func:`PyUnicode_New`, and will be removed in Python 3.12.
433432
434433
435434
.. c:function:: PyObject *PyUnicode_FromString(const char *u)
@@ -671,7 +670,7 @@ APIs:
671670
Deprecated Py_UNICODE APIs
672671
""""""""""""""""""""""""""
673672
674-
.. deprecated-removed:: 3.3 4.0
673+
.. deprecated-removed:: 3.3 3.12
675674
676675
These API functions are deprecated with the implementation of :pep:`393`.
677676
Extension modules can continue using them, as they will not be removed in Python
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update some deprecated unicode APIs which are documented as "will be removed
2+
in 4.0" to "3.12". See :pep:`623` for detail.

0 commit comments

Comments
 (0)