Skip to content

gh-131510: Use PyUnstable_Unicode_GET_CACHED_HASH() - #141520

Merged
encukou merged 1 commit into
python:mainfrom
vstinner:cached_hash
Nov 14, 2025
Merged

encukou merged 1 commit into
python:mainfrom
vstinner:cached_hash

Conversation

@vstinner

@vstinner vstinner commented Nov 13, 2025 •

Copy link
Copy Markdown
Member

Replace code accessing directly to PyASCIIObject.hash with PyUnstable_Unicode_GET_CACHED_HASH().

Remove redundant "assert(PyUnicode_Check(op))" from PyUnstable_Unicode_GET_CACHED_HASH(), _PyASCIIObject_CAST() already implements the check.

Replace code accessing directly to PyASCIIObject.hash with
PyUnstable_Unicode_GET_CACHED_HASH().

Remove redundant "assert(PyUnicode_Check(op))" from
PyUnstable_Unicode_GET_CACHED_HASH(), _PyASCIIObject_CAST() already
implements the check.
@vstinner

Copy link
Copy Markdown
Member Author
@encukou
encukou merged commit 3bacae5 into python:main Nov 14, 2025
@encukou

encukou commented Nov 14, 2025

Copy link
Copy Markdown
Member

Thank you!

@vstinner
vstinner deleted the cached_hash branch December 3, 2025 15:36
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
…41520)

Replace code that directly accesses PyASCIIObject.hash with
PyUnstable_Unicode_GET_CACHED_HASH().

Remove redundant "assert(PyUnicode_Check(op))" from
PyUnstable_Unicode_GET_CACHED_HASH(), _PyASCIIObject_CAST() already
implements the check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants