Skip to content

Commit d9f2a13

Browse files
authored
bpo-41123: Remove PyUnicode_GetMax() (pythonGH-21192)
1 parent 8bea91b commit d9f2a13

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

Doc/whatsnew/3.10.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,6 @@ Removed
223223
* ``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`
224224
* ``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use
225225
:c:func:`PyUnicode_FindChar`
226+
227+
* Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs.
228+
(Contributed by Inada Naoki in :issue:`41103`.)

Include/cpython/unicodeobject.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,6 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicodeAndSize(
593593
Py_ssize_t *size /* location where to save the length */
594594
);
595595

596-
/* Get the maximum ordinal for a Unicode character. */
597-
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
598-
599596

600597
/* --- _PyUnicodeWriter API ----------------------------------------------- */
601598

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Removed ``PyUnicode_GetMax()``.

Objects/unicodeobject.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -497,20 +497,6 @@ unicode_check_encoding_errors(const char *encoding, const char *errors)
497497
}
498498

499499

500-
/* The max unicode value is always 0x10FFFF while using the PEP-393 API.
501-
This function is kept for backward compatibility with the old API. */
502-
Py_UNICODE
503-
PyUnicode_GetMax(void)
504-
{
505-
#ifdef Py_UNICODE_WIDE
506-
return 0x10FFFF;
507-
#else
508-
/* This is actually an illegal character, so it should
509-
not be passed to unichr. */
510-
return 0xFFFF;
511-
#endif
512-
}
513-
514500
int
515501
_PyUnicode_CheckConsistency(PyObject *op, int check_content)
516502
{

0 commit comments

Comments
 (0)