blob: 784da609875008dbe462d5d7784b373936a47790 [file] [log] [blame]
# pylint: disable=missing-docstring
import typing
class Hasher(typing.Protocol):
"""A hashing algorithm, e.g. :func:`hashlib.sha256`."""
def update(self, blob: bytes):
...
def digest(self) -> bytes:
...
Generic = typing.TypeVar("Generic")
class HasherGeneric(typing.Protocol[Generic]):
"""A hashing algorithm, e.g. :func:`hashlib.sha256`."""
def update(self, blob: bytes):
...
def digest(self) -> bytes:
...
class Protocol: #pylint:disable=too-few-public-methods
pass
class HasherFake(Protocol):
"""A hashing algorithm, e.g. :func:`hashlib.sha256`."""
def update(self, blob: bytes): # [no-self-use, unused-argument]
...
def digest(self) -> bytes: # [no-self-use]
...