diff --git a/stdlib/_hashlib.pyi b/stdlib/_hashlib.pyi index e9e5ec8a2f8a..5c1a75eaa7fc 100644 --- a/stdlib/_hashlib.pyi +++ b/stdlib/_hashlib.pyi @@ -59,7 +59,7 @@ def compare_digest(a: ReadableBuffer, b: ReadableBuffer, /) -> bool: ... @overload def compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ... def get_fips_mode() -> int: ... -def hmac_new(key: bytes | bytearray, msg: ReadableBuffer = b"", digestmod: _DigestMod = None) -> HMAC: ... +def hmac_new(key: ReadableBuffer, msg: ReadableBuffer = b"", digestmod: _DigestMod = None) -> HMAC: ... if sys.version_info >= (3, 13): def new( @@ -117,7 +117,7 @@ else: def openssl_shake_128(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ... def openssl_shake_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ... -def hmac_digest(key: bytes | bytearray, msg: ReadableBuffer, digest: str) -> bytes: ... +def hmac_digest(key: ReadableBuffer, msg: ReadableBuffer, digest: str) -> bytes: ... def pbkdf2_hmac( hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: int | None = None ) -> bytes: ... diff --git a/stdlib/_zstd.pyi b/stdlib/_zstd.pyi index b4e3d7aaaa09..34b619f9b0b6 100644 --- a/stdlib/_zstd.pyi +++ b/stdlib/_zstd.pyi @@ -74,7 +74,7 @@ class ZstdDecompressor: @final class ZstdDict: - def __new__(cls, dict_content: bytes, /, *, is_raw: bool = False) -> Self: ... + def __new__(cls, dict_content: ReadableBuffer, /, *, is_raw: bool = False) -> Self: ... def __len__(self, /) -> int: ... @property def as_digested_dict(self) -> tuple[Self, int]: ... diff --git a/stdlib/binascii.pyi b/stdlib/binascii.pyi index 692c3e4f07bd..6840c6883811 100644 --- a/stdlib/binascii.pyi +++ b/stdlib/binascii.pyi @@ -26,7 +26,7 @@ if sys.version_info >= (3, 15): /, *, strict_mode: bool = False, - alphabet: ReadableBuffer = ..., + alphabet: bytes = ..., padded: bool = True, ignorechars: ReadableBuffer = ..., canonical: bool = False, @@ -41,7 +41,7 @@ if sys.version_info >= (3, 15): data: _AsciiBuffer, /, *, - alphabet: ReadableBuffer = ..., + alphabet: bytes = ..., padded: bool = True, ignorechars: ReadableBuffer = b"", canonical: bool = False, @@ -60,7 +60,7 @@ if sys.version_info >= (3, 15): ) -> bytes: ... def b2a_base85(data: ReadableBuffer, /, *, alphabet: ReadableBuffer = ..., pad: bool = False, wrapcol: int = 0) -> bytes: ... def a2b_base85( - data: _AsciiBuffer, /, *, alphabet: ReadableBuffer = ..., ignorechars: ReadableBuffer = b"", canonical: bool = False + data: _AsciiBuffer, /, *, alphabet: bytes = ..., ignorechars: ReadableBuffer = b"", canonical: bool = False ) -> bytes: ... elif sys.version_info >= (3, 11): diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index 833c411fab21..6a8456d1498e 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -286,7 +286,7 @@ class SSLSocket(socket.socket): def sendto(self, data: ReadableBuffer, flags_or_addr: int, addr: socket._Address) -> int: ... def shutdown(self, how: int) -> None: ... @deprecated("Deprecated since Python 3.6. Use `SSLSocket.recv` method instead.") - def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... + def read(self, len: int = 1024, buffer: WriteableBuffer | None = None) -> bytes: ... @deprecated("Deprecated since Python 3.6. Use `SSLSocket.send` method instead.") def write(self, data: ReadableBuffer) -> int: ... def do_handshake(self, block: bool = False) -> None: ... # block is undocumented @@ -443,7 +443,7 @@ class SSLObject: @property def session_reused(self) -> bool: ... def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... + def read(self, len: int = 1024, buffer: WriteableBuffer | None = None) -> bytes: ... def write(self, data: ReadableBuffer) -> int: ... @overload def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ...