gh-141226: correctly support Py_HASH_EXTERNAL for Unix platforms
#141245
+35
−4
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.
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_Funcis defined inpyhash.c: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
--with-hash-algorithm#141226📚 Documentation preview 📚: https://cpython-previews--141245.org.readthedocs.build/