Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-112066: UsePyDict_SetDefaultRef in place ofPyDict_SetDefault.#112211

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

colesbury
Copy link
Contributor

@colesburycolesbury commentedNov 17, 2023
edited
Loading

This changes a number of internal usages ofPyDict_SetDefault to usePyDict_SetDefaultRef.

serhiy-storchaka reacted with thumbs up emoji
Copy link
Member

@encukouencukou left a comment

Choose a reason for hiding this comment

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

+1 from me; IMO the chance of C-API WG having objections is low enough, let's be optimistic and merge this.

Comment on lines 986 to 990
if (res < 0) {
Py_DECREF(key);
return NULL;
}
if (res == 1) {

Choose a reason for hiding this comment

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

Maybe merge them in single test!= 0?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks - I combined the cases.

…fault`.This changes a number of internal usages of `PyDict_SetDefault` touse `PyDict_SetDefaultRef`.
@colesbury
Copy link
ContributorAuthor

I've rebased this PR now that#112123 is merged.@serhiy-storchaka, would you please look over this?

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@colesburycolesbury merged commitef3ceab intopython:mainFeb 7, 2024
@colesburycolesbury deleted the PyDict_SetDefaultRef-usage branchFebruary 7, 2024 18:43
@vstinner
Copy link
Member

Nice change, it makes the code more readable.

erlend-aasland reacted with thumbs up emoji

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull requestFeb 14, 2024
…fault`. (python#112211)This changes a number of internal usages of `PyDict_SetDefault` to use `PyDict_SetDefaultRef`.Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@encukouencukouencukou approved these changes

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

@erlend-aaslanderlend-aaslanderlend-aasland approved these changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@iritkatrieliritkatrielAwaiting requested review from iritkatrieliritkatriel is a code owner

@methanemethaneAwaiting requested review from methane

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@colesbury@vstinner@encukou@serhiy-storchaka@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp