Skip to content

Conversation

@picnixz
Copy link
Member

@picnixzpicnixz commented Nov 8, 2025

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:

#ifPy_HASH_ALGORITHM==Py_HASH_EXTERNALexternPyHash_FuncDefPyHash_Func; #elsestaticPyHash_FuncDefPyHash_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


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

@picnixz
Copy link
MemberAuthor

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

@picnixzpicnixz closed this Nov 8, 2025
@emmatyping
Copy link
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.

@picnixzpicnixz deleted the fix/capi/hash-external-141226 branch November 8, 2025 22:29
Sign up for freeto 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.

2 participants

@picnixz@emmatyping