FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-112026: Deprecate _PyDict_GetItemStringWithError() function by vstinner · Pull Request #119855 · python/cpython · GitHub

/ cpython Public

gh-112026: Deprecate _PyDict_GetItemStringWithError() function - #119855

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:depr_pydict_witherr
Jun 3, 2024
Merged

gh-112026: Deprecate _PyDict_GetItemStringWithError() function#119855
vstinner merged 1 commit into
python:mainfrom
vstinner:depr_pydict_witherr

Conversation

vstinner commented May 31, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

The function was removed in Python 3.13 alpha1 and added back to Python 3.13 alpha2 by #112119.

Copy link
Copy Markdown
Member Author

cc @serhiy-storchaka

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

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 *);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe 3.13?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I don't like adding new compiler warnings after beta1. There is no urgency to remove it.

Copy link
Copy Markdown
Member

_PyDict_GetItemStringWithError() is just a wrapper around PyDict_GetItemWithError(). There are no reasons of using it instead of your own wrapper around PyDict_GetItemWithError().

vstinner commented Jun 1, 2024

Copy link
Copy Markdown
Member Author

numpy and other projects used it. numpy was updated to use PyDict_GetItemStringRef() using pythoncapi-compat.

vstinner merged commit 70934fb into python:main Jun 3, 2024
vstinner deleted the depr_pydict_witherr branch June 3, 2024 08:26
JukkaL pushed a commit to python/mypy that referenced this pull request Oct 16, 2024
`_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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL