mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-124502: Add PyUnicode_Equal() function (#124504)
This commit is contained in:
parent
c5df1cb7bd
commit
a7f0727ca5
11 changed files with 111 additions and 2 deletions
|
@ -11001,6 +11001,24 @@ _PyUnicode_Equal(PyObject *str1, PyObject *str2)
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
PyUnicode_Equal(PyObject *str1, PyObject *str2)
|
||||
{
|
||||
if (!PyUnicode_Check(str1)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"first argument must be str, not %T", str1);
|
||||
return -1;
|
||||
}
|
||||
if (!PyUnicode_Check(str2)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"second argument must be str, not %T", str2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return _PyUnicode_Equal(str1, str2);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyUnicode_Compare(PyObject *left, PyObject *right)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue