Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-125449: Remove PyUnicode_READY function in unicodeobject.h #125450

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions Doc/data/refcounts.dat
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
7 changes: 0 additions & 7 deletions Include/cpython/unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove :c:func:`PyUnicode_READY` in ``unicodeobjecct.h``.
Loading