mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
Close #14648: Compute correctly maxchar in str.format() for substrin
This commit is contained in:
parent
0b7d7c9544
commit
ece58deb9f
4 changed files with 50 additions and 6 deletions
|
@ -710,6 +710,15 @@ PyAPI_FUNC(PyObject*) PyUnicode_Substring(
|
|||
Py_ssize_t start,
|
||||
Py_ssize_t end);
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
/* Compute the maximum character of the substring unicode[start:end].
|
||||
Return 127 for an empty string. */
|
||||
PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar (
|
||||
PyObject *unicode,
|
||||
Py_ssize_t start,
|
||||
Py_ssize_t end);
|
||||
#endif
|
||||
|
||||
/* Copy the string into a UCS4 buffer including the null character if copy_null
|
||||
is set. Return NULL and raise an exception on error. Raise a ValueError if
|
||||
the buffer is smaller than the string. Return buffer on success.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue