diff options
author | Victor Stinner <vstinner@python.org> | 2022-05-03 18:14:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 18:14:58 (GMT) |
commit | 2eca5dad0a783153318e91e3e25f16a38a632bfd (patch) | |
tree | 880d3aec57a1bfbefbdb28ff8ce03a16260a04f2 /Doc | |
parent | 415944379f9dae46e391315c9ccb17e45f9917da (diff) | |
download | cpython-2eca5dad0a783153318e91e3e25f16a38a632bfd.zip cpython-2eca5dad0a783153318e91e3e25f16a38a632bfd.tar.gz cpython-2eca5dad0a783153318e91e3e25f16a38a632bfd.tar.bz2 |
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.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/bytearray.rst | 4 | ||||
-rw-r--r-- | Doc/c-api/bytes.rst | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Doc/c-api/bytearray.rst b/Doc/c-api/bytearray.rst index 85a7d13..4bf3cfe 100644 --- a/Doc/c-api/bytearray.rst +++ b/Doc/c-api/bytearray.rst @@ -77,9 +77,9 @@ These macros trade safety for speed and they don't check pointers. .. c:function:: char* PyByteArray_AS_STRING(PyObject *bytearray) - Macro version of :c:func:`PyByteArray_AsString`. + Similar to :c:func:`PyByteArray_AsString`, but without error checking. .. c:function:: Py_ssize_t PyByteArray_GET_SIZE(PyObject *bytearray) - Macro version of :c:func:`PyByteArray_Size`. + Similar to :c:func:`PyByteArray_Size`, but without error checking. diff --git a/Doc/c-api/bytes.rst b/Doc/c-api/bytes.rst index 32c7b80..d47f042 100644 --- a/Doc/c-api/bytes.rst +++ b/Doc/c-api/bytes.rst @@ -134,7 +134,7 @@ called with a non-bytes parameter. .. c:function:: Py_ssize_t PyBytes_GET_SIZE(PyObject *o) - Macro form of :c:func:`PyBytes_Size` but without error checking. + Similar to :c:func:`PyBytes_Size`, but without error checking. .. c:function:: char* PyBytes_AsString(PyObject *o) @@ -151,7 +151,7 @@ called with a non-bytes parameter. .. c:function:: char* PyBytes_AS_STRING(PyObject *string) - Macro form of :c:func:`PyBytes_AsString` but without error checking. + Similar to :c:func:`PyBytes_AsString`, but without error checking. .. c:function:: int PyBytes_AsStringAndSize(PyObject *obj, char **buffer, Py_ssize_t *length) |