mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
This commit is contained in:
parent
5ebff7b300
commit
f4934ea77d
21 changed files with 120 additions and 75 deletions
|
@ -1638,6 +1638,9 @@ They all return *NULL* or ``-1`` if an exception occurs.
|
|||
Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, and greater than,
|
||||
respectively.
|
||||
|
||||
This function returns ``-1`` upon failure, so one should call
|
||||
:c:func:`PyErr_Occurred` to check for errors.
|
||||
|
||||
|
||||
.. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, const char *string)
|
||||
|
||||
|
@ -1646,6 +1649,9 @@ They all return *NULL* or ``-1`` if an exception occurs.
|
|||
ASCII-encoded strings, but the function interprets the input string as
|
||||
ISO-8859-1 if it contains non-ASCII characters.
|
||||
|
||||
This function returns ``-1`` upon failure, so one should call
|
||||
:c:func:`PyErr_Occurred` to check for errors.
|
||||
|
||||
|
||||
.. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue