Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 151934a

Browse files
authored
gh-122623: Improve c-api/bytearray.rst with error handling info (#122624)
1 parent 95f5c89 commit 151934a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Doc/c-api/bytearray.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,22 @@ Direct API functions
4242
Return a new bytearray object from any object, *o*, that implements the
4343
:ref:`buffer protocol <bufferobjects>`.
4444
45+
On failure, return ``NULL`` with an exception set.
46+
4547
4648
.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
4749
48-
Create a new bytearray object from *string* and its length, *len*. On
49-
failure, ``NULL`` is returned.
50+
Create a new bytearray object from *string* and its length, *len*.
51+
52+
On failure, return ``NULL`` with an exception set.
5053
5154
5255
.. c:function:: PyObject* PyByteArray_Concat(PyObject *a, PyObject *b)
5356
5457
Concat bytearrays *a* and *b* and return a new bytearray with the result.
5558
59+
On failure, return ``NULL`` with an exception set.
60+
5661
5762
.. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
5863

0 commit comments

Comments
 (0)