Skip to content

gh-132713: Simplify list_repr_impl() #132811

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

Merged
merged 1 commit into from
Apr 23, 2025
Merged

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 22, 2025

@vstinner
Copy link
Member Author

cc @kumaraditya303

break;
}
/* Hold a strong reference since repr(item) can mutate the list */
item = Py_NewRef(v->ob_item[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 from me. I like this pattern better

@vstinner vstinner merged commit de9deb7 into python:main Apr 23, 2025
49 checks passed
@vstinner vstinner deleted the list_repr2 branch April 23, 2025 06:59
@vstinner
Copy link
Member Author

Ok, merged. If later the code evolves and the safer list_get_item_ref() is needed, we can come back to list_get_item_ref() later.

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.

3 participants