8000 gh-112999: Replace the outdated "deprecated" directives with "versionchanged" by serhiy-storchaka · Pull Request #113000 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div class="d-flex flex-column flex-md-row flex-items-start flex-md-items-center">

gh-112999: Replace the outdated "deprecated" directives with "versionchanged" #113000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
17 changes: 7 additions & 10 deletions Doc/library/hmac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
This module implements the HMAC algorithm as described by :rfc:`2104`.


.. function:: new(key, msg=None, digestmod='')
.. function:: new(key, msg=None, digestmod)

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

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


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


.. deprecated:: 3.9

The undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, and
``HMAC.outer`` are internal implementation details and will be removed in
Python 3.10.
.. versionchanged:: 3.10
Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``,
and ``HMAC.outer``.

This module also provides the following helper function:

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ Functions for sequences
generated. For example, a sequence of length 2080 is the largest that
can fit within the period of the Mersenne Twister random number generator.

.. deprecated-removed:: 3.9 3.11
The optional parameter *random*.
.. versionchanged:: 3.11
Removed the optional parameter *random*.


.. function:: sample(population, k, *, counts=None)
Expand Down Expand Up @@ -407,9 +407,9 @@ Alternative Generator
Class that implements the default pseudo-random number generator used by the
:mod:`random` module.

.. deprecated-removed:: 3.9 3.11
.. versionchanged:: 3.11
Formerly the *seed* could be any hashable object. Now it is limited to:
:class:`NoneType`, :class:`int`, :class:`float`, :class:`str`,
``None``, :class:`int`, :class:`float`, :class:`str`,
:class:`bytes`, or :class:`bytearray`.

.. class:: SystemRandom([seed])
Expand Down
4 changes: 1 addition & 3 deletions Doc/using/cmdline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,7 @@ Miscellaneous options

.. versionadded:: 3.10
The ``-X warn_default_encoding`` option.

.. deprecated-removed:: 3.9 3.10
The ``-X oldparser`` option.
Removed the ``-X oldparser`` option.

.. versionadded:: 3.11
The ``-X no_debug_ranges`` option.
Expand Down
2 changes: 1 addition & 1 deletion Lib/hmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, key, msg=None, digestmod=''):
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)

if not digestmod:
raise TypeError("Missing required parameter 'digestmod'.")
raise TypeError("Missing required argument 'digestmod'.")

if _hashopenssl and isinstance(digestmod, (str, _functype)):
try:
Expand Down
0