Skip to content

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