mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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.
This commit is contained in:
parent
415944379f
commit
2eca5dad0a
4 changed files with 47 additions and 14 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue