]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89653: PEP 670: Convert PyBytes macros to functions (#91990)
authorVictor Stinner <vstinner@python.org>
Tue, 3 May 2022 18:14:58 +0000 (20:14 +0200)
committerGitHub <noreply@github.com>
Tue, 3 May 2022 18:14:58 +0000 (20:14 +0200)
commit2eca5dad0a783153318e91e3e25f16a38a632bfd
tree880d3aec57a1bfbefbdb28ff8ce03a16260a04f2
parent415944379f9dae46e391315c9ccb17e45f9917da
gh-89653: PEP 670: Convert PyBytes macros to functions (#91990)

Convert the following macros to static inline functions:

* PyByteArray_AS_STRING()
* PyByteArray_GET_SIZE()
* PyBytes_AS_STRING()
* PyBytes_GET_SIZE()

Limited C API version 3.11 no longer casts arguments.

Add _PyBytes_CAST() and _PyByteArray_CAST() macros.
Doc/c-api/bytearray.rst
Doc/c-api/bytes.rst
Include/cpython/bytearrayobject.h
Include/cpython/bytesobject.h