]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89653: PEP 670: Convert tuple macros to functions (#91786)
authorVictor Stinner <vstinner@python.org>
Thu, 21 Apr 2022 14:52:54 +0000 (16:52 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Apr 2022 14:52:54 +0000 (16:52 +0200)
commit2a5f171759a31597032cfe52646929e6f8727243
tree0ef894868fc9e6dec266dd9379c52610c60405bc
parent1b184c84082530f35c593cb7728752e258371c30
gh-89653: PEP 670: Convert tuple macros to functions (#91786)

Convert macros to static inline functions:

* PyTuple_GET_SIZE()
* PyTuple_SET_ITEM()
* PyList_GET_SIZE()
* PyList_SET_ITEM()

Add a macro converting arguments to PyTupleObject*, PyListObject* or
PyObject* to prevent emitting new compiler warnings.

According to PEP 670, PyTuple_GET_ITEM() and PyList_GET_ITEM() are
left as macros.
Include/cpython/listobject.h
Include/cpython/tupleobject.h