Skip to content

hashlib: fix arguments #3626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions stdlib/3/hashlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ class _Hash(object):
def hexdigest(self) -> str: ...
def update(self, arg: _DataType) -> None: ...

def md5(arg: _DataType = ...) -> _Hash: ...
def sha1(arg: _DataType = ...) -> _Hash: ...
def sha224(arg: _DataType = ...) -> _Hash: ...
def sha256(arg: _DataType = ...) -> _Hash: ...
def sha384(arg: _DataType = ...) -> _Hash: ...
def sha512(arg: _DataType = ...) -> _Hash: ...
if sys.version_info >= (3, 8):
def md5(string: _DataType = ...) -> _Hash: ...
def sha1(string: _DataType = ...) -> _Hash: ...
def sha224(string: _DataType = ...) -> _Hash: ...
def sha256(string: _DataType = ...) -> _Hash: ...
def sha384(string: _DataType = ...) -> _Hash: ...
def sha512(string: _DataType = ...) -> _Hash: ...
else:
def md5(__string: _DataType = ...) -> _Hash: ...
def sha1(__string: _DataType = ...) -> _Hash: ...
def sha224(__string: _DataType = ...) -> _Hash: ...
def sha256(__string: _DataType = ...) -> _Hash: ...
def sha384(__string: _DataType = ...) -> _Hash: ...
def sha512(__string: _DataType = ...) -> _Hash: ...

def new(name: str, data: _DataType = ...) -> _Hash: ...

Expand Down Expand Up @@ -55,7 +63,7 @@ if sys.version_info >= (3, 6):
shake_128 = _VarLenHash
shake_256 = _VarLenHash

def scrypt(password: _DataType, *, salt: _DataType, n: int, r: int, p: int, maxmem: int = ..., dklen: int = ...) -> bytes: ...
def scrypt(password: _DataType, *, salt: Optional[_DataType] = ..., n: Optional[int] = ..., r: Optional[int] = ..., p: Optional[int] = ..., maxmem: int = ..., dklen: int = ...) -> bytes: ...

class _BlakeHash(_Hash):
MAX_DIGEST_SIZE: int
Expand Down