mirror of https://github.com/python/cpython
[3.13] gh-122623: Improve `c-api/bytearray.rst` with error handling info (GH-122624) (#122658)
gh-122623: Improve `c-api/bytearray.rst` with error handling info (GH-122624)
(cherry picked from commit 151934a324
)
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
b1e95d6863
commit
9697b01fae
|
@ -42,17 +42,22 @@ Direct API functions
|
||||||
Return a new bytearray object from any object, *o*, that implements the
|
Return a new bytearray object from any object, *o*, that implements the
|
||||||
:ref:`buffer protocol <bufferobjects>`.
|
:ref:`buffer protocol <bufferobjects>`.
|
||||||
|
|
||||||
|
On failure, return ``NULL`` with an exception set.
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
|
.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
|
||||||
|
|
||||||
Create a new bytearray object from *string* and its length, *len*. On
|
Create a new bytearray object from *string* and its length, *len*.
|
||||||
failure, ``NULL`` is returned.
|
|
||||||
|
On failure, return ``NULL`` with an exception set.
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
|
.. c:function:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
|
||||||
|
|
||||||
Concat bytearrays *a* and *b* and return a new bytearray with the result.
|
Concat bytearrays *a* and *b* and return a new bytearray with the result.
|
||||||
|
|
||||||
|
On failure, return ``NULL`` with an exception set.
|
||||||
|
|
||||||
|
|
||||||
.. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
|
.. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue