PyByteArrayObject
PyObject
represents a Python bytearray object.PyByteArray_Type
PyTypeObject
represents the Python bytearray type; it is the same object as bytearray
in the Python layer.PyByteArray_Check
(PyObject *o)PyByteArray_CheckExact
(PyObject *o)
PyByteArray_FromObject
(PyObject *o)Return value: New reference.
Return a new bytearray object from any object, o, that implements the buffer protocol.
PyByteArray_FromStringAndSize
(const char *string, Py_ssize_t len)Return value: New reference.
Create a new bytearray object from string and its length, len. On
failure, NULL
is returned.
PyByteArray_Concat
(PyObject *a, PyObject *b)Return value: New reference.
Concat bytearrays a and b and return a new bytearray with the result.
PyByteArray_Size
(PyObject *bytearray)NULL
pointer.PyByteArray_AsString
(PyObject *bytearray)NULL
pointer. The returned array always has an extra null byte appended.PyByteArray_Resize
(PyObject *bytearray, Py_ssize_t len)
These macros trade safety for speed and they don’t check pointers.
PyByteArray_AS_STRING
(PyObject *bytearray)PyByteArray_AsString()
.PyByteArray_GET_SIZE
(PyObject *bytearray)PyByteArray_Size()
.