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
PyList_APPEND (append without incref) #50865
Comments
This patch was made on python r74276 Often when writing in C/Python I want to append to a list within a C eg:
PyObject *item= PyFloat_FromDouble(x);
PyList_Append(list, item);
Py_DECREF(item); I have seen people make mistakes with this (in pygame code and This simple patch allows... doc included. |
This isn't a good idea because the error checking Also, I'm not too keen on adding second-ways-to-do-it. It is better to learn to use the API as designed than |
Hi Raymond, in general I agree with your comments that adding 2 ways to For the same reason that PyList_SET_ITEM is useful, this is useful too. Loosing the error checking is a disadvantage but in many cases API's Python's own code does this in a few cases with PyList_SET_ITEM... |
Given that your level of skill is higher than the average user, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: