summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:17:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-11-16 08:17:58 (GMT)
commitf4934ea77da38516731a75fbf9458b248d26dd81 (patch)
tree9fe19276fac7661f433f86673ff7862663ed7693 /Doc
parent5ebff7b300448db36d0d0eda7d265caa06fce6d2 (diff)
downloadcpython-f4934ea77da38516731a75fbf9458b248d26dd81.zip
cpython-f4934ea77da38516731a75fbf9458b248d26dd81.tar.gz
cpython-f4934ea77da38516731a75fbf9458b248d26dd81.tar.bz2
Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/unicode.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index ef8273c..cc23060 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -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)