mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-129559: Add bytearray.resize()
(GH-129560)
Add bytearray.resize() which wraps PyByteArray_Resize. Make negative size passed to resize exception/error rather than crash in optimized builds.
This commit is contained in:
parent
7d9a22f509
commit
5fb019fc29
7 changed files with 158 additions and 9 deletions
|
@ -74,6 +74,11 @@ Direct API functions
|
|||
.. c:function:: int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)
|
||||
|
||||
Resize the internal buffer of *bytearray* to *len*.
|
||||
Failure is a ``-1`` return with an exception set.
|
||||
|
||||
.. versionchanged:: next
|
||||
A negative *len* will now result in an exception being set and -1 returned.
|
||||
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue