-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
[C API] Make _PyList_FromArraySteal() function public #111489
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
Comments
We should also make |
Can you wait until the new guidelines are approved? Not everyone is happy with the term steal. |
The name is discussed at capi-workgroup/problems#11 (comment) |
Naming is discussed at capi-workgroup/api-evolution#25 |
Add new functions to create tuple and list from arrays: * PyTuple_FromArray(). * PyTuple_FromArrayMoveRef(). * PyList_FromArrayMoveRef(). Add tests on new functions.
Add new functions to create tuple and list from arrays: * PyTuple_FromArray(). * PyTuple_FromArrayMoveRef(). * PyList_FromArrayMoveRef(). Add tests on new functions.
Add new functions to create tuple and list from arrays: * PyTuple_FromArray(). * PyTuple_FromArrayMoveRef(). * PyList_FromArrayMoveRef(). Add tests on new functions.
Add new functions to create tuple and list from arrays: * PyTuple_FromArray(). * PyTuple_FromArrayMoveRef(). * PyList_FromArrayMoveRef(). Add tests on new functions.
Ok, I close the issue. |
Uh oh!
There was an error while loading. Please reload this page.
I dislike
PyList_New()
+PyList_SET_ITEM()
API since the list is immediately tracked by the GC and so callinggc.get_objects()
can expose an invalid list object (ex: callingrepr(list)
can crash). See:The internal
PyObject * _PyList_FromArraySteal(PyObject *const *src, Py_ssize_t n)
function should be made public. But it should be renamed to avoid misleading "Steal" term: ownership is "moved" or "transfered", not "stolen".cc @erlend-aasland
Linked PRs
The text was updated successfully, but these errors were encountered: