diff --git a/stdlib/2/hashlib.pyi b/stdlib/2/hashlib.pyi index 375cc59aa..fa1dbce59 100644 --- a/stdlib/2/hashlib.pyi +++ b/stdlib/2/hashlib.pyi @@ -2,12 +2,14 @@ from typing import Tuple, Union -_DataType = Union[str, bytearray, buffer, memoryview] +_DataType = Union[str, unicode, bytearray, buffer, memoryview] -class _hash(object): - # This is not actually in the module namespace. - digest_size = 0 +class _hash(object): # This is not actually in the module namespace. + name = ... # type: str block_size = 0 + digest_size = 0 + digestsize = 0 + def __init__(self, arg: _DataType = ...) -> None: ... def update(self, arg: _DataType) -> None: ... def digest(self) -> str: ... def hexdigest(self) -> str: ... diff --git a/stdlib/2/md5.pyi b/stdlib/2/md5.pyi index 3488466af..fe6ad719d 100644 --- a/stdlib/2/md5.pyi +++ b/stdlib/2/md5.pyi @@ -1,11 +1,6 @@ # Stubs for Python 2.7 md5 stdlib module -class md5(object): - def update(self, arg: str) -> None: ... - def digest(self) -> str: ... - def hexdigest(self) -> str: ... - def copy(self) -> md5: ... +from hashlib import md5 as md5, md5 as new -def new(string: str = ...) -> md5: ... blocksize = 0 digest_size = 0