Files
typeshed/stdlib/3
Bruce Merry fb398b1d59 Use the ReadableBuffer type in more places (#4245)
This is a follow-up on #4232. memoryview, hashlib, and hmac are updated
to use ReadableBuffer type instead of their own home-spun unions of
bytes, bytearray and whatever else each use case used. mmap is being
handled in #4244, and I'll leave BinaryIO for another day (or possibly
another person) because it's going to require some messy code
duplication because the relevant methods are defined in IO[AnyStr].

There's one corner case I'm not quite sure how best to handle: the
documentation for hmac.digest claim that the parmaeters have the same
meanings as in hmac.new, but in CPython the latter has an explicit check
that `key` is bytes or bytearray while the former works with a
memory-view. For now I've matched the documentation.

Also, the documentation for HMAC.update says that `msg` can be any type
supported by hashlib from Python 3.4; but I can't see anything in the
Python 2.7 implementation that would prevent it also taking bytes-like
objects, so I've not tried to treat Python 2 any different to Python 3.
2020-06-22 06:17:24 -07:00
..
2020-06-09 12:20:09 +02:00
2019-10-29 19:52:05 -07:00
2020-06-11 09:10:52 +02:00
2020-06-11 09:10:52 +02:00
2019-07-27 10:58:21 +02:00
2020-01-21 17:52:38 -08:00
2020-06-10 20:57:09 -07:00
2020-02-29 22:03:50 -08:00
2020-05-16 16:51:13 -07:00
2017-04-30 14:16:30 -07:00
2020-02-05 19:14:30 -08:00
2020-05-27 22:05:55 -07:00
2020-02-21 11:55:11 +01:00
2020-02-21 11:57:07 +01:00
2018-08-18 19:25:48 -07:00
2020-06-11 09:10:52 +02:00
2020-02-21 21:23:34 -08:00
2020-03-06 11:02:18 +01:00
2019-07-27 10:58:21 +02:00
2020-03-06 11:12:24 +01:00