Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d27eb1e

Browse files
authored
gh-106320: Remove private _PyUnicode C API (#107185)
Move private _PyUnicode functions to the internal C API (pycore_unicodeobject.h): * _PyUnicode_IsCaseIgnorable() * _PyUnicode_IsCased() * _PyUnicode_IsXidContinue() * _PyUnicode_IsXidStart() * _PyUnicode_ToFoldedFull() * _PyUnicode_ToLowerFull() * _PyUnicode_ToTitleFull() * _PyUnicode_ToUpperFull() No longer export these functions.
1 parent 032f480 commit d27eb1e

File tree

2 files changed

+13
-36
lines changed

2 files changed

+13
-36
lines changed

Include/cpython/unicodeobject.h

-36
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,6 @@ PyAPI_FUNC(int) _PyUnicode_IsTitlecase(
473473
Py_UCS4 ch /* Unicode character */
474474
);
475475

476-
PyAPI_FUNC(int) _PyUnicode_IsXidStart(
477-
Py_UCS4 ch /* Unicode character */
478-
);
479-
480-
PyAPI_FUNC(int) _PyUnicode_IsXidContinue(
481-
Py_UCS4 ch /* Unicode character */
482-
);
483-
484476
PyAPI_FUNC(int) _PyUnicode_IsWhitespace(
485477
const Py_UCS4 ch /* Unicode character */
486478
);
@@ -501,34 +493,6 @@ PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase(
501493
Py_UCS4 ch /* Unicode character */
502494
);
503495

504-
PyAPI_FUNC(int) _PyUnicode_ToLowerFull(
505-
Py_UCS4 ch, /* Unicode character */
506-
Py_UCS4 *res
507-
);
508-
509-
PyAPI_FUNC(int) _PyUnicode_ToTitleFull(
510-
Py_UCS4 ch, /* Unicode character */
511-
Py_UCS4 *res
512-
);
513-
514-
PyAPI_FUNC(int) _PyUnicode_ToUpperFull(
515-
Py_UCS4 ch, /* Unicode character */
516-
Py_UCS4 *res
517-
);
518-
519-
PyAPI_FUNC(int) _PyUnicode_ToFoldedFull(
520-
Py_UCS4 ch, /* Unicode character */
521-
Py_UCS4 *res
522-
);
523-
524-
PyAPI_FUNC(int) _PyUnicode_IsCaseIgnorable(
525-
Py_UCS4 ch /* Unicode character */
526-
);
527-
528-
PyAPI_FUNC(int) _PyUnicode_IsCased(
529-
Py_UCS4 ch /* Unicode character */
530-
);
531-
532496
PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit(
533497
Py_UCS4 ch /* Unicode character */
534498
);

Include/internal/pycore_unicodeobject.h

+13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ extern "C" {
1111
#include "pycore_fileutils.h" // _Py_error_handler
1212
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
1313

14+
/* --- Characters Type APIs ----------------------------------------------- */
15+
16+
extern int _PyUnicode_IsXidStart(Py_UCS4 ch);
17+
extern int _PyUnicode_IsXidContinue(Py_UCS4 ch);
18+
extern int _PyUnicode_ToLowerFull(Py_UCS4 ch, Py_UCS4 *res);
19+
extern int _PyUnicode_ToTitleFull(Py_UCS4 ch, Py_UCS4 *res);
20+
extern int _PyUnicode_ToUpperFull(Py_UCS4 ch, Py_UCS4 *res);
21+
extern int _PyUnicode_ToFoldedFull(Py_UCS4 ch, Py_UCS4 *res);
22+
extern int _PyUnicode_IsCaseIgnorable(Py_UCS4 ch);
23+
extern int _PyUnicode_IsCased(Py_UCS4 ch);
24+
25+
/* --- Unicode API -------------------------------------------------------- */
26+
1427
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
1528
PyObject *op,
1629
int check_content);

0 commit comments

Comments
 (0)