字节数组对象¶
2.6 新版功能.
-
PyTypeObject
PyByteArray_Type
¶ This instance of
PyTypeObject
represents the Python bytearray type; it is the same object asbytearray
in the Python layer.
类型检查宏¶
直接 API 函数¶
-
PyObject*
PyByteArray_FromObject
(PyObject *o)¶ Return a new bytearray object from any object, o, that implements the buffer protocol.
-
PyObject*
PyByteArray_FromStringAndSize
(const char *string, Py_ssize_t len)¶ Create a new bytearray object from string and its length, len. On failure, NULL is returned.
-
Py_ssize_t
PyByteArray_Size
(PyObject *bytearray)¶ Return the size of bytearray after checking for a NULL pointer.
宏¶
这些宏减低安全性以换取性能,它们不检查指针。
-
char*
PyByteArray_AS_STRING
(PyObject *bytearray)¶ C函数
PyByteArray_AsString()
的宏版本。
-
Py_ssize_t
PyByteArray_GET_SIZE
(PyObject *bytearray)¶ C函数
PyByteArray_Size()
的宏版本。