bpo-30459: Cast the result of PyList_SET_ITEM() to void#19975
Conversation
Do the same for PyTuple_SET_ITEM().
vstinner
left a comment
There was a problem hiding this comment.
The initial issue seems to show that PyList_SET_ITEM() result can be used, but also that it is used in practice:
https://bugs.python.org/issue30459#msg294362
So I would suggest to document in the C API changes, Porting to Python 3.9:
https://docs.python.org/dev/whatsnew/3.9.html#id2
Sorry, something went wrong.
|
By the way, I added Py_SET_REFCNT(), Py_SET_TYPE() and Py_SET_SIZE() in Python 3.9, but I left the related Py_REFCNT(), Py_TYPE() and Py_SIZE() unchanged. It remains possible to use them as l-value for example: I expect that few C extensions use I chose to add new macros in Python 3.9, and maybe change the macros in Python 3.10. The change is part of a larger project: See bpo-39573. |
Sorry, something went wrong.
|
No activity since May, I close the PR. I created PR #23645 which converts PyTuple_SET_ITEM() and PyList_SET_ITEM() to static inline functions. |
Sorry, something went wrong.
|
Thanks @ZackerySpytz, I merged your PR. I wrote PR #23654 to modify also PyCell_SET(). |
Sorry, something went wrong.
Do the same for PyTuple_SET_ITEM().
Do the same for PyTuple_SET_ITEM().
https://bugs.python.org/issue30459