hashlib: fix sha3 and shake hash constructors, remove hash object __init__s (#12906)

This commit is contained in:
Brian Schubert
2024-10-25 10:14:40 -04:00
committed by GitHub
parent fc8bff1b26
commit efccd7455a
3 changed files with 25 additions and 21 deletions

View File

@@ -417,8 +417,6 @@ csv.DictWriter.__init__ # runtime sig has *args but will error if more than 5 p
dataclasses.field # White lies around defaults
email.policy.EmailPolicy.message_factory # "type" at runtime, but protocol in stubs
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
# We can't distinguish not having a default value from having a default value of inspect.Parameter.empty

View File

@@ -262,3 +262,7 @@ email._header_value_parser.SPECIALSNL
email.errors.HeaderWriteError
email.utils.getaddresses
email.utils.parseaddr
# Weird special builtins that are typed as functions, but aren't functions
hashlib.sha3_\d+ # Class in 3.8, can't be subclassed at runtime, built-in function 3.9+
hashlib.shake_\d+ # Class in 3.8, can't be subclassed at runtime, built-in function 3.9+