Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/deprecations/c-api-pending-removal-in-3.17.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Pending removal in Python 3.17
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* :pep:`456` embedders support for the string hashing scheme definition.
4 changes: 4 additions & 0 deletions Doc/deprecations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, we'll also need to backport this fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you prefer that I open a separate PR for that? I can definitely do so for miss-ilington.


.. 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
Expand Down
12 changes: 12 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to rush this and not use the preferred five years?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err.. I forgot the 5 years. I did a +2 version but I can definitely do a +5 years. However, note that I couldn't find any (public) code that was using this feature so I guessed we could drop this.

Actually, as I told Victor, the maintenance cost on our side won't change at all because we already have all the infrastructure in place except for actually enabling this feature during the build (but all the code is already there and is straightforward). What is however hard to maintain are the docs for that (it's not easy to explain what needs to be done) and if users use this feature wrongly, it becomes a really bad footgun.

I think "advanced users" (embedders) would rather patch the entire file instead of relying on this as our configure script doesn't even support this...


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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion Python/pyhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the most portable way of indicating the warning but I'm not entirely sure (it's only used in the getter function some lines below)

#else
static PyHash_FuncDef PyHash_Func;
#endif
Expand Down
Loading