Skip to content

gh-158219: Clear the cached hash when bytearray adopts a bytes buffer - #158222

Open
cmaloney wants to merge 1 commit into
python:mainfrom
cmaloney:gh-158219-bytearray-stale-hash
Open

cmaloney wants to merge 1 commit into
python:mainfrom
cmaloney:gh-158219-bytearray-stale-hash

Conversation

@cmaloney

@cmaloney cmaloney commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Change so mutable bytes adopted by bytearray have their hash cleared. Ensure that bytes which are considerable mutable have a clear hash so it is computed only after they are immutable.

…buffer

Change so mortal bytes adopted by `bytearray` have their hash
cleared. Ensure that bytes which are considerable mutable have a clear
hash so it is computed only after they are immutable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cmaloney
cmaloney requested a review from vstinner September 26, 2026 06:47
@cmaloney cmaloney added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant