mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +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:
commit
3b73ea1278
22 changed files with 125 additions and 80 deletions
|
@ -1643,6 +1643,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)
|
||||
|
||||
|
@ -1651,6 +1654,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