Skip to content

Commit f78f6b6

Browse files
[3.11] gh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH-113000) (GH-113020)
(cherry picked from commit fe9991b)
1 parent 8298f44 commit f78f6b6

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

Doc/library/hmac.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
This module implements the HMAC algorithm as described by :rfc:`2104`.
1515

1616

17-
.. function:: new(key, msg=None, digestmod='')
17+
.. function:: new(key, msg=None, digestmod)
1818

1919
Return a new hmac object. *key* is a bytes or bytearray object giving the
2020
secret key. If *msg* is present, the method call ``update(msg)`` is made.
@@ -27,10 +27,9 @@ This module implements the HMAC algorithm as described by :rfc:`2104`.
2727
Parameter *msg* can be of any type supported by :mod:`hashlib`.
2828
Parameter *digestmod* can be the name of a hash algorithm.
2929

30-
.. deprecated-removed:: 3.4 3.8
31-
MD5 as implicit default digest for *digestmod* is deprecated.
32-
The digestmod parameter is now required. Pass it as a keyword
33-
argument to avoid awkwardness when you do not have an initial msg.
30+
.. versionchanged:: 3.8
31+
The *digestmod* argument is now required. Pass it as a keyword
32+
argument to avoid awkwardness when you do not have an initial *msg*.
3433

3534

3635
.. function:: digest(key, msg, digest)
@@ -114,11 +113,9 @@ A hash object has the following attributes:
114113
.. versionadded:: 3.4
115114

116115

117-
.. deprecated:: 3.9
118-
119-
The undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, and
120-
``HMAC.outer`` are internal implementation details and will be removed in
121-
Python 3.10.
116+
.. versionchanged:: 3.10
117+
Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``,
118+
and ``HMAC.outer``.
122119

123120
This module also provides the following helper function:
124121

Doc/library/random.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ Functions for sequences
221221
generated. For example, a sequence of length 2080 is the largest that
222222
can fit within the period of the Mersenne Twister random number generator.
223223

224-
.. deprecated-removed:: 3.9 3.11
225-
The optional parameter *random*.
224+
.. versionchanged:: 3.11
225+
Removed the optional parameter *random*.
226226

227227

228228
.. function:: sample(population, k, *, counts=None)
@@ -383,9 +383,9 @@ Alternative Generator
383383
Class that implements the default pseudo-random number generator used by the
384384
:mod:`random` module.
385385

386-
.. deprecated:: 3.9
387-
In the future, the *seed* must be one of the following types:
388-
:class:`NoneType`, :class:`int`, :class:`float`, :class:`str`,
386+
.. versionchanged:: 3.11
387+
Formerly the *seed* could be any hashable object. Now it is limited to:
388+
``None``, :class:`int`, :class:`float`, :class:`str`,
389389
:class:`bytes`, or :class:`bytearray`.
390390

391391
.. class:: SystemRandom([seed])

Doc/using/cmdline.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,7 @@ Miscellaneous options
569569

570570
.. versionadded:: 3.10
571571
The ``-X warn_default_encoding`` option.
572-
573-
.. deprecated-removed:: 3.9 3.10
574-
The ``-X oldparser`` option.
572+
Removed the ``-X oldparser`` option.
575573

576574
.. versionadded:: 3.11
577575
The ``-X no_debug_ranges`` option.

Lib/hmac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self, key, msg=None, digestmod=''):
5353
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
5454

5555
if not digestmod:
56-
raise TypeError("Missing required parameter 'digestmod'.")
56+
raise TypeError("Missing required argument 'digestmod'.")
5757

5858
if _hashopenssl and isinstance(digestmod, (str, _functype)):
5959
try:

0 commit comments

Comments
 (0)