Uh oh!
There was an error while loading. Please reload this page.
gh-112026: Restore removed _PyDict_GetItemStringWithError() - #112119
Conversation
Restore the removed _PyDict_GetItemStringWithError() function. It is used by numpy.
vstinner
commented
Nov 15, 2023
@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. |
serhiy-storchaka
commented
Nov 15, 2023
Is not PyObject*_PyDict_GetItemStringWithError(PyObject*obj, constchar*key)
{
PyObject*value;
(void)PyDict_GetItemStringRef(obj, key, &value);
if (Py_REFCNT(value) ==1) {
Py_DECREF(value);
returnNULL;
}
Py_DECREF(value);
returnvalue;
} |
vstinner
commented
Nov 15, 2023
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.
ngoldbaum
commented
Apr 15, 2024
See numpy/numpy#26282, would also appreciate code review if you have time. |
vstinner
commented
May 31, 2024
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.