mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-08 22:36:18 +08:00
Introduce the _HashObject protocol (#13553)
This protocol corresponds to what is called "hash object" in the hashlib documentation. In particular, it includes the non-OpenSSL BLAKE2 implementations which do not inherit HASH.
This commit is contained in:
+2
-1
@@ -2,6 +2,7 @@ import sys
|
||||
from _blake2 import blake2b as blake2b, blake2s as blake2s
|
||||
from _hashlib import (
|
||||
HASH,
|
||||
_HashObject,
|
||||
openssl_md5 as md5,
|
||||
openssl_sha1 as sha1,
|
||||
openssl_sha224 as sha224,
|
||||
@@ -97,7 +98,7 @@ if sys.version_info >= (3, 11):
|
||||
def readable(self) -> bool: ...
|
||||
|
||||
def file_digest(
|
||||
fileobj: _BytesIOLike | _FileDigestFileObj, digest: str | Callable[[], HASH], /, *, _bufsize: int = 262144
|
||||
fileobj: _BytesIOLike | _FileDigestFileObj, digest: str | Callable[[], _HashObject], /, *, _bufsize: int = 262144
|
||||
) -> HASH: ...
|
||||
|
||||
# Legacy typing-only alias
|
||||
|
||||
Reference in New Issue
Block a user