Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-111489: Add PyTuple_FromArray() function#139691
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
vstinner commented Oct 7, 2025 • edited by github-actions bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by github-actions bot
Uh oh!
There was an error while loading. Please reload this page.
vstinner commented Oct 7, 2025
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner commented Oct 7, 2025
@serhiy-storchaka: I addressed your comments. Please review the updated PR. |
| tup= () | ||
| copy=tuple_fromarray(tup) | ||
| self.assertIs(copy, tup) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not the empty tuple singleton a CPython implementation detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole file is a CPython implementation detail (_testcapi), no?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Use also UNINITIALIZED_SIZE in test code.
vstinner commented Oct 7, 2025
I updated the PR for the latest review. |
serhiy-storchaka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
| Create a tuple of *size* items and copy references from *array* to the new | ||
| tuple. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to formulate this in words more similar to PyTuple_New() or PyTuple_Pack() ("Return a new tuple object of size ... "), but this is not so important.
encukou commented Oct 7, 2025
Implementation looks good, thanks! Do you want to open a WG vote for this? |
vstinner commented Oct 7, 2025
I created capi-workgroup/decisions#79. |
vstinner commented Oct 7, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I exchanged
|
vstinner commented Oct 8, 2025
Sorry, I changed my preference back to |
vstinner commented Oct 10, 2025
The C API Working Group accepted this API. |
e31c22d into python:mainUh oh!
There was an error while loading. Please reload this page.
vstinner commented Oct 10, 2025
Merged. Thanks for your review @serhiy-storchaka and @encukou! |
vstinner commented Oct 14, 2025
I added the function to pythoncapi-compat: python/pythoncapi-compat@89e023e |
📚 Documentation preview 📚: https://cpython-previews--139691.org.readthedocs.build/