-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-112026: Restore removed _PyDict_GetItemStringWithError() #112119
Conversation
Restore the removed _PyDict_GetItemStringWithError() function. It is used by numpy.
@serhiy-storchaka: This private function is no longer used by Python, but I restore it to unblock numpy on Python 3.13 (keep dependency in the Python ecosystem). Later, I plan to deprecate this function and write documentation on how to update existing code using it. Apparently, just removing private functions without providing any solution didn't "please" users. |
Is not PyObject *
_PyDict_GetItemStringWithError(PyObject *obj, const char *key)
{
PyObject *value;
(void)PyDict_GetItemStringRef(obj, key, &value);
if (Py_REFCNT(value) == 1) {
Py_DECREF(value);
return NULL;
}
Py_DECREF(value);
return value;
} |
Solution to which problem? numpy doesn't built if Python C API doesn't contain _PyDict_GetItemStringWithError(). I restored the function to unblock numpy. I plan to update numpy, deprecate _PyDict_GetItemStringWithError(), and later remove it. |
…thon#112119) Restore the removed _PyDict_GetItemStringWithError() function. It is used by numpy.
See numpy/numpy#26282, would also appreciate code review if you have time. |
I wrote #119855 to deprecate _PyDict_GetItemStringWithError(). |
…thon#112119) Restore the removed _PyDict_GetItemStringWithError() function. It is used by numpy.
Restore the removed _PyDict_GetItemStringWithError() function. It is used by numpy.