GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-112026: Deprecate _PyDict_GetItemStringWithError() function by vstinner · Pull Request #119855 · python/cpython

Conversation

@vstinner

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

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: [C API] Revert of private functions removed in Python 3.13 causing most problems #112026

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-112026: Deprecate _PyDict_GetItemStringWithError() function
163bcfc
@vstinner vstinner added skip news topic-C-API labels May 31, 2024
@bedevere-app bedevere-app Bot added the awaiting core review label May 31, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 31, 2024
[C API] Revert of private functions removed in Python 3.13 causing most problems #112026
Closed
@vstinner

vstinner commented May 31, 2024

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request May 31, 2024
gh-112026: Restore removed _PyDict_GetItemStringWithError() #112119
Merged
@vstinner

vstinner commented May 31, 2024

Copy link
Copy Markdown
Member Author

cc @serhiy-storchaka

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka reviewed Jun 1, 2024
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Include/cpython/dictobject.h
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 *);

@serhiy-storchaka serhiy-storchaka Jun 1, 2024

Copy link
Copy Markdown
Member

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@vstinner vstinner Jun 1, 2024

Copy link
Copy Markdown
Member Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
serhiy-storchaka
serhiy-storchaka approved these changes Jun 1, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Jun 1, 2024
@serhiy-storchaka

serhiy-storchaka commented Jun 1, 2024

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().

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner
vstinner merged commit 70934fb into python:main Jun 3, 2024
@vstinner
vstinner deleted the depr_pydict_witherr branch June 3, 2024 08:26
@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 3, 2024
mliezun pushed a commit to mliezun/cpython that referenced this pull request Jun 3, 2024
@vstinner @mliezun
pythongh-112026: Deprecate _PyDict_GetItemStringWithError() function (p…
77d328b
…ython#119855)
barneygale pushed a commit to barneygale/cpython that referenced this pull request Jun 5, 2024
@vstinner @barneygale
pythongh-112026: Deprecate _PyDict_GetItemStringWithError() function (p…
02f2a16
…ython#119855)
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@vstinner @estyxx
pythongh-112026: Deprecate _PyDict_GetItemStringWithError() function (p…
b822e58
…ython#119855)
@cdce8p cdce8p mentioned this pull request Oct 13, 2024
[mypyc] Replace deprecated _PyDict_GetItemStringWithError python/mypy#17930
Merged
JukkaL pushed a commit to python/mypy that referenced this pull request Oct 16, 2024
@cdce8p
[mypyc] Replace deprecated _PyDict_GetItemStringWithError (#17930)
f63fdb3
`_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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-C-API

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@vstinner @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.