Skip to content

gh-161226: Fail if the hash is cached in _PyTuple_Resize() - #161293

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:tuple_resize_hash
Nov 5, 2026
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:tuple_resize_hash

Conversation

@vstinner

@vstinner vstinner commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

_PyTuple_Resize() now fails with SystemError if the hash value was already computed.

Add compute_hash optional parameter to _testcapi._tuple_resize().

_PyTuple_Resize() now fails with SystemError if the hash value was
already computed.

Add compute_hash optional parameter to _testcapi._tuple_resize().
@vstinner

vstinner commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

This change is backward incompatible on purpose, and so it should not be backported to stable branches.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35630941 | 📁 Comparing 4adeb75 against main (6d69297)

  🔍 Preview build  

2 files changed
± c-api/tuple.html
± whatsnew/changelog.html

@vstinner
vstinner merged commit 1405607 into python:main Nov 5, 2026
102 of 104 checks passed
@vstinner
vstinner deleted the tuple_resize_hash branch November 5, 2026 13:28
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.

1 participant