gh-142217: Remove internal _Py_Identifier functions (#142219)

Remove internal functions:

* _PyDict_ContainsId()
* _PyDict_DelItemId()
* _PyDict_GetItemIdWithError()
* _PyDict_SetItemId()
* _PyEval_GetBuiltinId()
* _PyObject_CallMethodIdNoArgs()
* _PyObject_CallMethodIdObjArgs()
* _PyObject_CallMethodIdOneArg()
* _PyObject_VectorcallMethodId()
* _PyUnicode_EqualToASCIIId()

These functions were not exported and so no usable outside CPython.
This commit is contained in:
Victor Stinner 2025-12-03 14:33:32 +01:00 committed by GitHub
parent 4172644d78
commit 7e5fcae09b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 0 additions and 172 deletions

View file

@ -11194,47 +11194,6 @@ _PyUnicode_EqualToASCIIString(PyObject *unicode, const char *str)
memcmp(PyUnicode_1BYTE_DATA(unicode), str, len) == 0;
}
int
_PyUnicode_EqualToASCIIId(PyObject *left, _Py_Identifier *right)
{
PyObject *right_uni;
assert(_PyUnicode_CHECK(left));
assert(right->string);
#ifndef NDEBUG
for (const char *p = right->string; *p; p++) {
assert((unsigned char)*p < 128);
}
#endif
if (!PyUnicode_IS_ASCII(left))
return 0;
right_uni = _PyUnicode_FromId(right); /* borrowed */
if (right_uni == NULL) {
/* memory error or bad data */
PyErr_Clear();
return _PyUnicode_EqualToASCIIString(left, right->string);
}
if (left == right_uni)
return 1;
assert(PyUnicode_CHECK_INTERNED(right_uni));
if (PyUnicode_CHECK_INTERNED(left)) {
return 0;
}
Py_hash_t right_hash = PyUnicode_HASH(right_uni);
assert(right_hash != -1);
Py_hash_t hash = PyUnicode_HASH(left);
if (hash != -1 && hash != right_hash) {
return 0;
}
return unicode_eq(left, right_uni);
}
PyObject *
PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
{