fix nullability of scrypt params (#10942)

This commit is contained in:
Benedikt Radtke
2023-10-29 01:35:39 +02:00
committed by GitHub
parent f85c2f4ae1
commit 1196915b39
2 changed files with 2 additions and 8 deletions

View File

@@ -113,14 +113,7 @@ shake_128 = _VarLenHash
shake_256 = _VarLenHash
def scrypt(
password: ReadableBuffer,
*,
salt: ReadableBuffer | None = None,
n: int | None = None,
r: int | None = None,
p: int | None = None,
maxmem: int = 0,
dklen: int = 64,
password: ReadableBuffer, *, salt: ReadableBuffer, n: int, r: int, p: int, maxmem: int = 0, dklen: int = 64
) -> bytes: ...
@final
class _BlakeHash(_Hash):

View File

@@ -416,6 +416,7 @@ csv.DictWriter.__init__ # runtime sig has *args but will error if more than 5 p
contextvars.Context.__init__ # C signature is broader than what is actually accepted
dataclasses.field # White lies around defaults
hashlib.scrypt # Raises TypeError if salt, n, r or p are None
hashlib.sha3_\d+ # Can be a class or a built-in function, can't be subclassed at runtime
hashlib.shake_\d+ # Can be a class or a built-in function, can't be subclassed at runtime
hmac.HMAC.blocksize # use block_size instead