Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a56d4e8

Browse files
committed
whatsnew: hmac accepts more bytes types, importlib decode_source, stat in C.
1 parent 5147e00 commit a56d4e8

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Doc/whatsnew/3.4.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,16 @@ New :func:`hashlib.pbkdf2_hmac` function.
732732
(Contributed by Christian Heimes in :issue:`18582`)
733733

734734

735+
hmac
736+
----
737+
738+
:mod:`hmac` now accepts ``bytearray`` as well as ``bytes`` for the *key*
739+
argument to the :func:`~hmac.new` function, and the *msg* parameter to both the
740+
:func:`~hmac.new` function and the :meth:`~hmac.HMAC.update` method now
741+
accepts any type supported by the :mod:`hashlib` module. (Contributed
742+
by Jonas Borgström in :issue:`18240`.)
743+
744+
735745
html
736746
----
737747

@@ -794,6 +804,10 @@ the :class:`.InspectLoader` ABC, which means that ``runpy`` and
794804
``python -m`` can now be used with namespace packages. (Contributed
795805
by Brett Cannon in :issue:`18058`.)
796806

807+
:mod:`importlib.util` has a new function :func:`~importlib.util.decode_source`
808+
that decodes source from bytes using universal newline processing. This is
809+
useful for implementing :meth:`.InspectLoader.get_source` methods.
810+
797811

798812
inspect
799813
-------
@@ -1387,6 +1401,10 @@ Other Improvements
13871401

13881402
* ``python -m`` now works with namespace packages.
13891403

1404+
* The :mod:`stat` module is now implemented in C, which means it gets the
1405+
values for its constants from the C header files, instead of having the
1406+
values hard-coded in the python module as was previously the case.
1407+
13901408

13911409

13921410
Significant Optimizations

Misc/NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2346,7 +2346,7 @@ Library
23462346
- Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a
23472347
segfault inside the _pickle C extension.
23482348

2349-
- Issue 18240: The HMAC module is no longer restricted to bytes and accepts
2349+
- Issue #18240: The HMAC module is no longer restricted to bytes and accepts
23502350
any bytes-like object, e.g. memoryview. Original patch by Jonas Borgström.
23512351

23522352
- Issue #18224: Removed pydoc script from created venv, as it causes problems

0 commit comments

Comments
 (0)