mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Update type hints for the hashlib.new() stub (#4973)
Python 3.9 added the usedforsecurity kwarg as discussed in: https://bugs.python.org/issue9216 The stubs for the other constructors were updated to reflect this change, but the stub for new() was missed.
This commit is contained in:
@@ -17,6 +17,7 @@ class _Hash(object):
|
||||
def update(self, __data: ReadableBuffer) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def new(name: str, data: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
|
||||
def md5(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
|
||||
def sha1(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
|
||||
def sha224(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
|
||||
@@ -25,6 +26,7 @@ if sys.version_info >= (3, 9):
|
||||
def sha512(string: ReadableBuffer = ..., *, usedforsecurity: bool = ...) -> _Hash: ...
|
||||
|
||||
elif sys.version_info >= (3, 8):
|
||||
def new(name: str, data: ReadableBuffer = ...) -> _Hash: ...
|
||||
def md5(string: ReadableBuffer = ...) -> _Hash: ...
|
||||
def sha1(string: ReadableBuffer = ...) -> _Hash: ...
|
||||
def sha224(string: ReadableBuffer = ...) -> _Hash: ...
|
||||
@@ -33,6 +35,7 @@ elif sys.version_info >= (3, 8):
|
||||
def sha512(string: ReadableBuffer = ...) -> _Hash: ...
|
||||
|
||||
else:
|
||||
def new(name: str, data: ReadableBuffer = ...) -> _Hash: ...
|
||||
def md5(__string: ReadableBuffer = ...) -> _Hash: ...
|
||||
def sha1(__string: ReadableBuffer = ...) -> _Hash: ...
|
||||
def sha224(__string: ReadableBuffer = ...) -> _Hash: ...
|
||||
@@ -40,8 +43,6 @@ else:
|
||||
def sha384(__string: ReadableBuffer = ...) -> _Hash: ...
|
||||
def sha512(__string: ReadableBuffer = ...) -> _Hash: ...
|
||||
|
||||
def new(name: str, data: ReadableBuffer = ...) -> _Hash: ...
|
||||
|
||||
algorithms_guaranteed: AbstractSet[str]
|
||||
algorithms_available: AbstractSet[str]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user