gh-105156: Cleanup usage of old Py_UNICODE type (#105158) · python/cpython@7d07e58 · GitHub
Skip to content

Commit 7d07e58

Browse files
authored
gh-105156: Cleanup usage of old Py_UNICODE type (#105158)
* refcounts.dat: * Remove Py_UNICODE functions. * Replace Py_UNICODE argument type with wchar_t. * _PyUnicode_ToLowercase(), _PyUnicode_ToUppercase(), _PyUnicode_ToTitlecase() are no longer deprecated in comments. It's no longer needed since they now use Py_UCS4 type, rather than the deprecated Py_UNICODE type. * gdb: Remove unused char_width() method.
1 parent 424049c commit 7d07e58

4 files changed

Lines changed: 27 additions & 53 deletions

File tree

Doc/data/refcounts.dat

Lines changed: 20 additions & 40 deletions

Include/cpython/unicodeobject.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ static inline Py_UCS4 PyUnicode_MAX_CHAR_VALUE(PyObject *op)
379379

380380
/* === Public API ========================================================= */
381381

382-
/* --- Plain Py_UNICODE --------------------------------------------------- */
383-
384382
/* With PEP 393, this is the recommended way to allocate a new unicode object.
385383
This function will allocate the object and its buffer in a single memory
386384
block. Objects created using this function are not resizable. */
@@ -827,15 +825,15 @@ PyAPI_FUNC(int) _PyUnicode_IsLinebreak(
827825
const Py_UCS4 ch /* Unicode character */
828826
);
829827

830-
/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase(
828+
PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase(
831829
Py_UCS4 ch /* Unicode character */
832830
);
833831

834-
/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase(
832+
PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase(
835833
Py_UCS4 ch /* Unicode character */
836834
);
837835

838-
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase(
836+
PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase(
839837
Py_UCS4 ch /* Unicode character */
840838
);
841839

Objects/stringlib/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ the following defines used by the different modules:
99

1010
STRINGLIB_CHAR
1111

12-
the type used to hold a character (char or Py_UNICODE)
12+
the type used to hold a character (char, Py_UCS1, Py_UCS2 or Py_UCS4)
1313

1414
STRINGLIB_GET_EMPTY()
1515

Tools/gdb/libpython.py

Lines changed: 3 additions & 7 deletions

0 commit comments

Comments
 (0)