]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-129559: Add `bytearray.resize()` (GH-129560)
authorCody Maloney <cmaloney@users.noreply.github.com>
Wed, 5 Feb 2025 19:33:17 +0000 (11:33 -0800)
committerGitHub <noreply@github.com>
Wed, 5 Feb 2025 19:33:17 +0000 (11:33 -0800)
commit5fb019fc29a90e722aff20a9522bf588351358cd
tree770f00e6589fa23f48883cb1d6a44435f8e10c49
parent7d9a22f50923309955a2caf7d57013f224071e6e
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.
Doc/c-api/bytearray.rst
Doc/library/stdtypes.rst
Lib/test/test_bytes.py
Lib/test/test_capi/test_bytearray.py
Misc/NEWS.d/next/Library/2025-02-01-14-55-33.gh-issue-129559.hQCeAz.rst [new file with mode: 0644]
Objects/bytearrayobject.c
Objects/clinic/bytearrayobject.c.h