mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-13 03:40:54 +08:00
Drop Python 3.8 branches (#13776)
This commit is contained in:
+8
-26
@@ -5,16 +5,22 @@ from _hashlib import (
|
||||
_HashObject,
|
||||
openssl_md5 as md5,
|
||||
openssl_sha1 as sha1,
|
||||
openssl_sha3_224 as sha3_224,
|
||||
openssl_sha3_256 as sha3_256,
|
||||
openssl_sha3_384 as sha3_384,
|
||||
openssl_sha3_512 as sha3_512,
|
||||
openssl_sha224 as sha224,
|
||||
openssl_sha256 as sha256,
|
||||
openssl_sha384 as sha384,
|
||||
openssl_sha512 as sha512,
|
||||
openssl_shake_128 as shake_128,
|
||||
openssl_shake_256 as shake_256,
|
||||
pbkdf2_hmac as pbkdf2_hmac,
|
||||
scrypt as scrypt,
|
||||
)
|
||||
from _typeshed import ReadableBuffer
|
||||
from collections.abc import Callable, Set as AbstractSet
|
||||
from typing import Protocol, type_check_only
|
||||
from typing import Protocol
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
__all__ = (
|
||||
@@ -60,31 +66,7 @@ else:
|
||||
"pbkdf2_hmac",
|
||||
)
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = ...) -> HASH: ...
|
||||
from _hashlib import (
|
||||
openssl_sha3_224 as sha3_224,
|
||||
openssl_sha3_256 as sha3_256,
|
||||
openssl_sha3_384 as sha3_384,
|
||||
openssl_sha3_512 as sha3_512,
|
||||
openssl_shake_128 as shake_128,
|
||||
openssl_shake_256 as shake_256,
|
||||
)
|
||||
|
||||
else:
|
||||
@type_check_only
|
||||
class _VarLenHash(HASH):
|
||||
def digest(self, length: int) -> bytes: ... # type: ignore[override]
|
||||
def hexdigest(self, length: int) -> str: ... # type: ignore[override]
|
||||
|
||||
def new(name: str, data: ReadableBuffer = b"") -> HASH: ...
|
||||
# At runtime these aren't functions but classes imported from _sha3
|
||||
def sha3_224(string: ReadableBuffer = b"") -> HASH: ...
|
||||
def sha3_256(string: ReadableBuffer = b"") -> HASH: ...
|
||||
def sha3_384(string: ReadableBuffer = b"") -> HASH: ...
|
||||
def sha3_512(string: ReadableBuffer = b"") -> HASH: ...
|
||||
def shake_128(string: ReadableBuffer = b"") -> _VarLenHash: ...
|
||||
def shake_256(string: ReadableBuffer = b"") -> _VarLenHash: ...
|
||||
def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = ...) -> HASH: ...
|
||||
|
||||
algorithms_guaranteed: AbstractSet[str]
|
||||
algorithms_available: AbstractSet[str]
|
||||
|
||||
Reference in New Issue
Block a user