KEMBAR78
gh-129005: Update _pyio.BytesIO to use bytearray.resize on write by cmaloney · Pull Request #129702 · python/cpython · GitHub
Skip to content

Conversation

@cmaloney
Copy link
Contributor

@cmaloney cmaloney commented Feb 5, 2025

bytearray.resize() does the nulling if needed. Including the new write length, n, since doing two resizes in a row to do the memcpy doesn't seem worthwhile.

I think this can skip news as it's internal implementation change with no visible external changes, should just be faster.

Co-authored-by: Victor Stinner <vstinner@python.org>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner vstinner enabled auto-merge (squash) February 6, 2025 09:56
@vstinner vstinner merged commit 052ca8f into python:main Feb 6, 2025
42 checks passed
@cmaloney cmaloney deleted the cmaloney/pyio_readinto_resize branch February 6, 2025 17:46
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Feb 7, 2025
cmaloney added a commit to cmaloney/cpython that referenced this pull request Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants