Skip to content

gh-108308: Replace _PyDict_GetItemStringWithError() - #108372

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:dict_getref2
Aug 23, 2023
Merged

gh-108308: Replace _PyDict_GetItemStringWithError()#108372
vstinner merged 1 commit into
python:mainfrom
vstinner:dict_getref2

Conversation

@vstinner

@vstinnervstinner commented Aug 23, 2023

Copy link
Copy Markdown
Member

Replace _PyDict_GetItemStringWithError() calls with PyDict_GetItemStringRef() which returns a strong reference to the item.

@serhiy-storchakaserhiy-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.

Good change!

Comment threadObjects/structseq.c Outdated
Comment threadPython/pylifecycle.c
Comment threadPython/pylifecycle.c
Comment threadPython/pylifecycle.c Outdated
Comment threadPython/pylifecycle.c
Replace _PyDict_GetItemStringWithError() calls with
PyDict_GetItemStringRef() which returns a strong reference to the
item.
Co-Authored-by: Serhiy Storchaka <storchaka@gmail.com>
@vstinner

Copy link
Copy Markdown
MemberAuthor

@serhiy-storchaka: I integrated your suggested changes and made you as a co-author. I addressed your review. Would you mind to review the updated PR?

@vstinner
vstinner merged commit 4dc9f48 into python:mainAug 23, 2023
@vstinner
vstinner deleted the dict_getref2 branch August 23, 2023 20:59
@serhiy-storchaka

Copy link
Copy Markdown
Member

@serhiy-storchaka: I integrated your suggested changes and made you as a co-author.

Oh, it was minor comment. I like how this API allows to write the code in multiple ways, to better fit in every particular case.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@serhiy-storchaka@bedevere-bot