-
-
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: Deprecate _PyDict_GetItemStringWithError() function #119855
Conversation
vstinner
commented
May 31, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: [C API] Revert of private functions removed in Python 3.13 causing most problems #112026
The function was removed in Python 3.13 alpha1 and added back to Python 3.13 alpha2 by #112119. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we should bother with deprecating the internal C API. It can be removed or changed in incompatible way at any time.
@@ -37,7 +37,8 @@ typedef struct { | |||
|
|||
PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key, | |||
Py_hash_t hash); | |||
PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObject *, const char *); | |||
// PyDict_GetItemStringRef() can be used instead | |||
Py_DEPRECATED(3.14) PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObject *, const char *); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe 3.13?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like adding new compiler warnings after beta1. There is no urgency to remove it.
|
numpy and other projects used it. numpy was updated to use PyDict_GetItemStringRef() using pythoncapi-compat. |
`_PyDict_GetItemStringWithError ` was deprecated for Python 3.14 in python/cpython#119855. Use `PyDict_GetItemStringRef` instead. It was added in 3.13 but is available via `pythoncapi_compat.h`. https://docs.python.org/3/c-api/dict.html#c.PyDict_GetItemStringRef