From ad8f488432b043702efd194a3334167c7413c846 Mon Sep 17 00:00:00 2001 From: ruang Date: Mon, 14 Oct 2024 20:28:49 +0800 Subject: [PATCH 1/2] Remove PyUnicode_READY --- Doc/c-api/unicode.rst | 10 ---------- Doc/data/refcounts.dat | 3 --- Include/cpython/unicodeobject.h | 7 ------- 3 files changed, 20 deletions(-) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 958fafd47ac81b..29b0b0355eefa6 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -87,16 +87,6 @@ access to internal read-only data of Unicode objects: subtype. This function always succeeds. -.. c:function:: int PyUnicode_READY(PyObject *unicode) - - Returns ``0``. This API is kept only for backward compatibility. - - .. versionadded:: 3.3 - - .. deprecated:: 3.10 - This API does nothing since Python 3.12. - - .. c:function:: Py_ssize_t PyUnicode_GET_LENGTH(PyObject *unicode) Return the length of the Unicode string, in code points. *unicode* has to be a diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index 65d48f8bea7de8..9733f19c19d7c3 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -2765,9 +2765,6 @@ PyUnicode_WriteChar:PyObject*:unicode:0: PyUnicode_WriteChar:Py_ssize_t:index:: PyUnicode_WriteChar:Py_UCS4:character:: -PyUnicode_READY:int::: -PyUnicode_READY:PyObject*:o:0: - PyUnicode_Substring:PyObject*::+1: PyUnicode_Substring:PyObject*:str:0: PyUnicode_Substring:Py_ssize_t:start:: diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index 91799137101280..26ea8b5dda5020 100644 --- a/Include/cpython/unicodeobject.h +++ b/Include/cpython/unicodeobject.h @@ -388,13 +388,6 @@ PyAPI_FUNC(PyObject*) PyUnicode_New( Py_UCS4 maxchar /* maximum code point value in the string */ ); -/* For backward compatibility */ -static inline int PyUnicode_READY(PyObject* Py_UNUSED(op)) -{ - return 0; -} -#define PyUnicode_READY(op) PyUnicode_READY(_PyObject_CAST(op)) - /* Copy character from one unicode object into another, this function performs character conversion when necessary and falls back to memcpy() if possible. From c2cd7e29de84220a2eb64b8a14d2eb9d930d3cce Mon Sep 17 00:00:00 2001 From: ruang Date: Mon, 14 Oct 2024 20:31:01 +0800 Subject: [PATCH 2/2] Add NEWS --- .../next/C_API/2024-10-14-20-29-52.gh-issue-125449.eoS-Ru.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/C_API/2024-10-14-20-29-52.gh-issue-125449.eoS-Ru.rst diff --git a/Misc/NEWS.d/next/C_API/2024-10-14-20-29-52.gh-issue-125449.eoS-Ru.rst b/Misc/NEWS.d/next/C_API/2024-10-14-20-29-52.gh-issue-125449.eoS-Ru.rst new file mode 100644 index 00000000000000..915af0faaa3013 --- /dev/null +++ b/Misc/NEWS.d/next/C_API/2024-10-14-20-29-52.gh-issue-125449.eoS-Ru.rst @@ -0,0 +1 @@ +Remove :c:func:`PyUnicode_READY` in ``unicodeobjecct.h``.