diff --git a/Doc/deprecations/c-api-pending-removal-in-3.17.rst b/Doc/deprecations/c-api-pending-removal-in-3.17.rst new file mode 100644 index 00000000000000..646afbf0b078f2 --- /dev/null +++ b/Doc/deprecations/c-api-pending-removal-in-3.17.rst @@ -0,0 +1,4 @@ +Pending removal in Python 3.17 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* :pep:`456` embedders support for the string hashing scheme definition. diff --git a/Doc/deprecations/index.rst b/Doc/deprecations/index.rst index f3cecb321d633f..7579121c0633ff 100644 --- a/Doc/deprecations/index.rst +++ b/Doc/deprecations/index.rst @@ -18,6 +18,10 @@ C API deprecations .. include:: c-api-pending-removal-in-3.15.rst +.. include:: c-api-pending-removal-in-3.16.rst + +.. include:: c-api-pending-removal-in-3.17.rst + .. include:: c-api-pending-removal-in-3.18.rst .. include:: c-api-pending-removal-in-3.20.rst diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index 5379ac3abba227..8a7acef98ae6a4 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -844,6 +844,18 @@ Deprecated New deprecations ---------------- +* Build: + + * Deprecate :pep:`456` support for providing an external definition + of the string hashing scheme. Removal is scheduled for Python 3.17. + + Previously, embedders could define :c:macro:`Py_HASH_ALGORITHM` to be + ``Py_HASH_EXTERNAL`` to indicate that the hashing scheme was provided + externally but this feature was undocumented, untested and most likely + unused. + + (Contributed by Bénédikt Tran in :gh:`141226`.) + * CLI: * Deprecate :option:`-b` and :option:`!-bb` command-line options diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-11-09-15-44-58.gh-issue-141226.KTb_3F.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-09-15-44-58.gh-issue-141226.KTb_3F.rst new file mode 100644 index 00000000000000..60bc9b201a45f3 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-11-09-15-44-58.gh-issue-141226.KTb_3F.rst @@ -0,0 +1,3 @@ +Deprecate :pep:`456` support for providing an external definition +of the string hashing scheme. Removal is scheduled for Python 3.17. +Patch by Bénédikt Tran. diff --git a/Python/pyhash.c b/Python/pyhash.c index 216f437dd9a2d4..b6b4ee225c097e 100644 --- a/Python/pyhash.c +++ b/Python/pyhash.c @@ -17,7 +17,7 @@ _Py_HashSecret_t _Py_HashSecret = {{0}}; #if Py_HASH_ALGORITHM == Py_HASH_EXTERNAL -extern PyHash_FuncDef PyHash_Func; +Py_DEPRECATED(3.15) extern PyHash_FuncDef PyHash_Func; #else static PyHash_FuncDef PyHash_Func; #endif