Skip to content

Commit ae0e0c3

Browse files
committed
amend deprecation notes
1 parent 26f01fa commit ae0e0c3

File tree

4 files changed

+32
-20
lines changed

4 files changed

+32
-20
lines changed

Doc/deprecations/pending-removal-in-3.17.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
Pending removal in Python 3.17
22
------------------------------
33

4-
* :mod:`hashlib`:
5-
6-
- Supporting the undocumented ``string`` keyword parameter in :func:`~hashlib.new`
7-
and hash function constructors such as :func:`~hashlib.md5` is deprecated.
8-
Use the ``data`` keyword parameter instead, or simply pass the data to hash
9-
as a positional argument.
10-
11-
Before Python 3.13, the ``string`` keyword parameter was not correctly
12-
supported depending on the backend implementation of hash functions, and
13-
users should prefer passing the data to hash as a positional argument.
14-
154
* :mod:`typing`:
165

176
- Before Python 3.14, old-style unions were implemented using the private class

Doc/deprecations/pending-removal-in-3.19.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,19 @@ Pending removal in Python 3.19
66
* Implicitly switching to the MSVC-compatible struct layout by setting
77
:attr:`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_`
88
on non-Windows platforms.
9+
10+
* :mod:`hashlib`:
11+
12+
- In hash function constructors such as :func:`~hashlib.new` or the
13+
direct hash-named constructors such as :func:`~hashlib.md5` and
14+
:func:`~hashlib.sha256`, their optional initial data parameter could
15+
also be passed a keyword argument named ``data=`` or ``string=`` in
16+
various :mod:`!hashlib` implementations.
17+
18+
Support for the ``string`` keyword argument name is now deprecated
19+
and slated for removal in Python 3.19.
20+
21+
Before Python 3.13, the ``string`` keyword parameter was not correctly
22+
supported depending on the backend implementation of hash functions.
23+
Prefer passing the initial data as a positional argument for maximum
24+
backwards compatibility.

Doc/whatsnew/3.15.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,16 @@ Deprecated
132132
hashlib
133133
-------
134134

135-
* Supporting the undocumented ``string`` keyword parameter in
136-
:func:`~hashlib.new` and hash function constructors such as
137-
:func:`~hashlib.md5` is deprecated and slated for removal in Python 3.17.
138-
Use the ``data`` keyword parameter instead, or simply pass the data to hash
139-
as a positional argument.
135+
* In hash function constructors such as :func:`~hashlib.new` or the
136+
direct hash-named constructors such as :func:`~hashlib.md5` and
137+
:func:`~hashlib.sha256`, their optional initial data parameter could
138+
also be passed a keyword argument named ``data=`` or ``string=`` in
139+
various :mod:`hashlib` implementations.
140+
141+
Support for the ``string`` keyword argument name is now deprecated and
142+
is slated for removal in Python 3.19. Prefer passing the initial data as
143+
a positional argument for maximum backwards compatibility.
144+
140145
(Contributed by Bénédikt Tran in :gh:`134978`.)
141146

142147

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
Supporting the undocumented ``string`` keyword parameter in :func:`hashlib.new`
2-
and hash function constructors such as :func:`hashlib.md5` is deprecated and
3-
slated for removal in Python 3.17. Use the ``data`` keyword parameter instead,
4-
or simply pass the data to hash as a positional argument.
1+
:mod:`hashlib`: Supporting the ``string`` keyword parameter in hash function
2+
constructors such as :func:`~hashlib.new` or the direct hash-named constructors
3+
such as :func:`~hashlib.md5` and :func:`~hashlib.sha256` is now deprecated and
4+
slated for removal in Python 3.19.
5+
Prefer passing the initial data as a positional argument for maximum backwards
6+
compatibility.
57
Patch by Bénédikt Tran.

0 commit comments

Comments
 (0)