-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-129559: Add bytearray.resize()
#129560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 15 commits
e240327
925fcbd
29c04ad
d15ef67
d199032
18829a2
df779e2
facc91f
d8b9faf
7429cf4
c183116
dd46a85
69bbdc1
ec4aa3d
336299a
1a0e157
cf89ec1
ddc7b09
a49374b
298d052
2f6b0a3
bf00f33
8df7b02
43e46dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2841,6 +2841,13 @@ objects. | |
| optional *sep* and *bytes_per_sep* parameters to insert separators | ||
| between bytes in the hex output. | ||
|
|
||
| .. method:: resize(size) | ||
|
|
||
| Resize the :class:`bytearray` to contain *size* bytes. | ||
gpshead marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| If :class:`bytearray` needs to grow, all new bytes will be set to null bytes. | ||
|
||
|
|
||
| .. versionadded:: next | ||
|
|
||
| Since bytearray objects are sequences of integers (akin to a list), for a | ||
| bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be | ||
| a bytearray object of length 1. (This contrasts with text strings, where | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Add :meth:`bytearray.resize` method to :class:`bytearray` wrapping | ||
| :c:func:`PyByteArray_Resize` so :class:`bytearray` can be efficiently | ||
| resized in place. | ||
cmaloney marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.