]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)
authorVictor Stinner <vstinner@python.org>
Wed, 27 May 2020 12:55:10 +0000 (14:55 +0200)
committerGitHub <noreply@github.com>
Wed, 27 May 2020 12:55:10 +0000 (14:55 +0200)
commitfe2978b3b940fe2478335e3a2ca5ad22338cdf9c
tree046e4e97f50b96d62239f8081f7ce6263ef02d78
parent20941de0ddc39ce9f07e29b4cc770e8a9ef14d41
bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)

Convert Py_REFCNT() and Py_SIZE() macros to static inline functions.
They cannot be used as l-value anymore: use Py_SET_REFCNT() and
Py_SET_SIZE() to set an object reference count and size.

Replace &Py_SIZE(self) with &((PyVarObject*)self)->ob_size
in arraymodule.c.

This change is backward incompatible on purpose, to prepare the C API
for an opaque PyObject structure.
Doc/c-api/structures.rst
Doc/whatsnew/3.10.rst
Include/object.h
Misc/NEWS.d/next/C API/2020-05-26-16-21-47.bpo-39573.depAgq.rst [new file with mode: 0644]
Modules/arraymodule.c
Objects/tupleobject.c