Skip to content
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

Use PyDict_GetItemRef() #111789

Closed
serhiy-storchaka opened this issue Nov 6, 2023 · 2 comments
Closed

Use PyDict_GetItemRef() #111789

serhiy-storchaka opened this issue Nov 6, 2023 · 2 comments

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Nov 6, 2023

The following PR makes the code, that currently uses PyDict_GetItemWithError() which returns a borrowing reference and then call Py_INCREF() on the result to make a strong reference, to use PyDict_GetItemRef().

cc @vstinner

Linked PRs

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 6, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 7, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 7, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 7, 2023
serhiy-storchaka added a commit that referenced this issue Nov 10, 2023
Use new C API functions PyDict_GetItemRef() and
PyMapping_GetOptionalItemString().
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 11, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 11, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 11, 2023
@gvanrossum
Copy link
Member

It would perhaps be easier to review if there was one PR per file touched. That way the expert for a given file can approve (or even merge) without having to say something like "okay for foobar.c" and the PR author won't have to keep track of which files are approved.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 14, 2023
ambv added a commit that referenced this issue Feb 23, 2024
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Use new C API functions PyDict_GetItemRef() and
PyMapping_GetOptionalItemString().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants