Skip to content

Commit

Permalink
[3.12] gh-122623: Improve c-api/bytearray.rst with error handling i…
Browse files Browse the repository at this point in the history
…nfo (GH-122624) (#122659)

gh-122623: Improve `c-api/bytearray.rst` with error handling info (GH-122624)
(cherry picked from commit 151934a)

Co-authored-by: sobolevn <[email protected]>
  • Loading branch information
miss-islington and sobolevn authored Aug 3, 2024
1 parent 8f1b385 commit 62f224a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Doc/c-api/bytearray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,22 @@ Direct API functions
Return a new bytearray object from any object, *o*, that implements the
:ref:`buffer protocol <bufferobjects>`.
On failure, return ``NULL`` with an exception set.
.. c:function:: 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.
Create a new bytearray object from *string* and its length, *len*.
On failure, return ``NULL`` with an exception set.
.. c:function:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
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)
Expand Down

0 comments on commit 62f224a

Please sign in to comment.