GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-106320: Move private _PyHash API to the internal C API by vstinner · Pull Request #107026 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Jul 22, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • No longer export most private _PyHash symbols, only export the ones which are needed by shared extensions.
  • Modules/_xxtestfuzz/fuzzer.c now uses the internal C API.
  • Issue: C API: Remove private C API functions (move them to the internal C API) #106320

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
pythongh-106320: Move private _PyHash API to the internal C API
485029b
* No longer export most private _PyHash symbols, only export the ones
  which are needed by shared extensions.
* Modules/_xxtestfuzz/fuzzer.c now uses the internal C API.
@vstinner vstinner added the skip news label Jul 22, 2023
@vstinner
vstinner requested a review from tiran as a code owner July 22, 2023 13:22
@bedevere-bot bedevere-bot added the awaiting core review label Jul 22, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jul 22, 2023
C API: Remove private C API functions (move them to the internal C API) #106320
Closed
@vstinner
vstinner enabled auto-merge (squash) July 22, 2023 13:28
@vstinner
vstinner merged commit 89f9875 into python:main Jul 22, 2023
@bedevere-bot bedevere-bot removed the awaiting core review label Jul 22, 2023
@vstinner
vstinner deleted the pycore_pyhash branch July 22, 2023 14:04
illia-v added a commit to illia-v/oss-fuzz that referenced this pull request Jul 28, 2023
@illia-v
Fix building CPython after python/cpython#107026
a8fef59
`Modules/_xxtestfuzz/fuzzer.c` in CPython started using private API in python/cpython@89f9875#diff-a22ac7579f23068e0c6bcacf1086ee962fdf8e68725cf0510b42d0a389cf1efd.

This made fuzzing builds fail https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60831.

Including needed header files fixes the error.
jonathanmetzman pushed a commit to google/oss-fuzz that referenced this pull request Jul 31, 2023
@illia-v
Fix building CPython after python/cpython#107026 (#10758)
d9270d0
`Modules/_xxtestfuzz/fuzzer.c` in CPython started using private API in
python/cpython@89f9875#diff-a22ac7579f23068e0c6bcacf1086ee962fdf8e68725cf0510b42d0a389cf1efd.

This made fuzzing builds fail
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60831.

Including needed header files fixes the error.
@skirpichev

skirpichev commented Oct 23, 2023

Copy link
Copy Markdown
Member

Again, as in #108604, the gmpy2 uses some parts of this API, e.g. to hash mpz like int. Meanwhile I did gmpy2/gmpy2#441 to workaround removed API. @vstinner, what we could do instead?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev skirpichev mentioned this pull request Oct 27, 2023
Consider restoring _PyHASH_INF/BITS/MODULUS/IMAG as public #111389
Closed
@vstinner

vstinner commented Oct 27, 2023

Copy link
Copy Markdown
Member Author

Again, as in #108604, the gmpy2 uses some parts of this API, e.g. to hash mpz like int. Meanwhile I did gmpy2/gmpy2#441 to workaround removed API. @vstinner, what we could do instead?

Would you mind to open a new issue, give the exhaustive list of functions that you need, and which API do you expect?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@skirpichev skirpichev mentioned this pull request Oct 28, 2023
gh-111389: expose _PyHASH_INF/BITS/MODULUS/IMAG macros as public #111418
Merged
skirpichev added a commit to skirpichev/cpython that referenced this pull request Oct 28, 2023
@skirpichev
pythongh-111389: restoring _PyHASH_INF/BITS/MODULUS/IMAG macroses as …
0ce377a
…public

This partially reverts python#107026.
@vstinner vstinner mentioned this pull request Oct 30, 2023
[C API] Meta issue: add new public functions with doc+tests to replace removed private functions #111481
Closed
@befeleme befeleme mentioned this pull request Oct 30, 2023
BUG: error: implicit declaration of function ‘_Py_HashDouble’ (building with Python 3.13~alpha1) numpy/numpy#25035
Closed
dmrlawson pushed a commit to dmrlawson/capnpy that referenced this pull request Jun 9, 2025
David Lawson
_hash.pyx: fix string hashing in 3.13
57fb87d
_Py_HashBytes was hidden in 3.13 (python/cpython#107026).

> C assumes that any function with an "implicit declaration" returns an int, which'll be smaller than a Py_hash_t, hence the different results. (https://groups.google.com/g/cython-users/c/YQkU8oc8oSM/m/nVJ_IX8KAgAJ)
dmrlawson pushed a commit to dmrlawson/capnpy that referenced this pull request Jun 9, 2025
David Lawson
_hash.pyx: fix string hashing in 3.13
9a95872
_Py_HashBytes was hidden in 3.13 (python/cpython#107026).

> C assumes that any function with an "implicit declaration" returns an int, which'll be smaller than a Py_hash_t, hence the different results. (https://groups.google.com/g/cython-users/c/YQkU8oc8oSM/m/nVJ_IX8KAgAJ)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tiran tiran Awaiting requested review from tiran

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @skirpichev @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.