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-141226: correctly support `Py_HASH_EXTERNAL` for Unix platforms by picnixz · Pull Request #141245 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Nov 8, 2025 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

I will need to test this manually. However, do we have give docs for embedders that would provide custom implementations? It's really "figure how to link your embedded implementation but here's what you need to provide". Is it sufficient? PyHash_Func is defined in pyhash.c:

#if Py_HASH_ALGORITHM == Py_HASH_EXTERNAL
extern PyHash_FuncDef PyHash_Func;
#else
static PyHash_FuncDef PyHash_Func;
#endif

I guess it's sufficient if we use the correct linker flags but I'm not entirely sure whether I should document this as well. It's a really niche thing (and I'm not aware of anyone doing this; everyone uses the default hash functions that is siphash13 and this hash function is used by most programming languages and the Linux kernel so I don't see why someone would need to change this except for performance reasons such as SIMD implementations).

Note that we cannot just remove this feature because it's part of PEP-456. I can write a PEP to officially deprecate it but I don't think it's worth SC's or my time.

cc @encukou @vstinner

  • Issue: Deprecate Py_HASH_EXTERNAL as it cannot be used for --with-hash-algorithm #141226

📚 Documentation preview 📚: https://cpython-previews--141245.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
@picnixz
correctly support Py_HASH_EXTERNAL for Unix platforms
58d8642
@picnixz
picnixz requested review from AA-Turner, corona10, emmatyping and erlend-aasland as code owners November 8, 2025 13:32
@bedevere-app bedevere-app Bot added the awaiting core review label Nov 8, 2025
@picnixz picnixz added skip news and removed awaiting core review labels Nov 8, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Nov 8, 2025
Deprecate Py_HASH_EXTERNAL as it cannot be used for --with-hash-algorithm #141226
Closed
@picnixz picnixz added the awaiting core review label Nov 8, 2025
@picnixz

picnixz commented Nov 8, 2025

Copy link
Copy Markdown
Member Author

Let's deprecate this as it's a tricky feature to document and to use.

emmatyping reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@picnixz picnixz closed this Nov 8, 2025
@emmatyping

emmatyping commented Nov 8, 2025

Copy link
Copy Markdown
Member

Let's deprecate this as it's a tricky feature to document and to use.

Agreed, and while it was defined in a PEP, I don't think it would take a PEP to deprecate it unless people feel one is necessary IMO.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
picnixz deleted the fix/capi/hash-external-141226 branch November 8, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@emmatyping emmatyping Awaiting requested review from emmatyping emmatyping is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

awaiting core review 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.

2 participants

@picnixz @emmatyping
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.