Use PEP 570 syntax in stdlib (#11250)

This commit is contained in:
Shantanu
2024-03-09 14:50:16 -08:00
committed by GitHub
parent 63737acac6
commit 470a13ab09
139 changed files with 2412 additions and 2371 deletions

View File

@@ -59,7 +59,7 @@ class _Hash:
def copy(self) -> Self: ...
def digest(self) -> bytes: ...
def hexdigest(self) -> str: ...
def update(self, __data: ReadableBuffer) -> None: ...
def update(self, data: ReadableBuffer, /) -> None: ...
if sys.version_info >= (3, 9):
def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = ...) -> _Hash: ...
@@ -92,9 +92,9 @@ class _VarLenHash:
name: str
def __init__(self, data: ReadableBuffer = ...) -> None: ...
def copy(self) -> _VarLenHash: ...
def digest(self, __length: int) -> bytes: ...
def hexdigest(self, __length: int) -> str: ...
def update(self, __data: ReadableBuffer) -> None: ...
def digest(self, length: int, /) -> bytes: ...
def hexdigest(self, length: int, /) -> str: ...
def update(self, data: ReadableBuffer, /) -> None: ...
sha3_224 = _Hash
sha3_256 = _Hash
@@ -116,7 +116,8 @@ class _BlakeHash(_Hash):
if sys.version_info >= (3, 9):
def __init__(
self,
__data: ReadableBuffer = ...,
data: ReadableBuffer = ...,
/,
*,
digest_size: int = ...,
key: ReadableBuffer = ...,
@@ -134,7 +135,8 @@ class _BlakeHash(_Hash):
else:
def __init__(
self,
__data: ReadableBuffer = ...,
data: ReadableBuffer = ...,
/,
*,
digest_size: int = ...,
key: ReadableBuffer = ...,
@@ -157,9 +159,9 @@ if sys.version_info >= (3, 11):
def getbuffer(self) -> ReadableBuffer: ...
class _FileDigestFileObj(Protocol):
def readinto(self, __buf: bytearray) -> int: ...
def readinto(self, buf: bytearray, /) -> int: ...
def readable(self) -> bool: ...
def file_digest(
__fileobj: _BytesIOLike | _FileDigestFileObj, __digest: str | Callable[[], _Hash], *, _bufsize: int = 262144
fileobj: _BytesIOLike | _FileDigestFileObj, digest: str | Callable[[], _Hash], /, *, _bufsize: int = 262144
) -> _Hash: ...