Skip to content

Commit

Permalink
Fix type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimes committed Jan 2, 2024
1 parent b16f508 commit 300f8e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mmh3/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ StrHashable = Union[str, Hashable]

def hash(key: StrHashable, seed: int = 0, signed: bool = True) -> int: ...
def hash_from_buffer(key: StrHashable, seed: int = 0, signed: bool = True) -> int: ...
def hash64(key: StrHashable, seed: int = 0, signed: bool = True) -> tuple[int, int]: ...
def hash128(key: StrHashable, seed: int = 0, signed: bool = True) -> int: ...
def hash_bytes(key: StrHashable, seed: int = 0, signed: bool = True) -> bytes: ...
def hash64(key: StrHashable, seed: int = 0, x64arch:bool = True, signed: bool = True) -> tuple[int, int]: ...
def hash128(key: StrHashable, seed: int = 0, x64arch:bool = True, signed: bool = False) -> int: ...
def hash_bytes(key: StrHashable, seed: int = 0, x64arch: bool = True) -> bytes: ...

class Hasher:
def __init__(self, seed: int = 0) -> None: ...
Expand Down
5 changes: 5 additions & 0 deletions tests/test_mmh3.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ def test_hash_from_buffer() -> None:

def test_hash_bytes() -> None:
assert mmh3.hash_bytes("foo") == b"aE\xf5\x01W\x86q\xe2\x87}\xba+\xe4\x87\xaf~"
assert (
mmh3.hash_bytes("foo", 0, True)
== b"aE\xf5\x01W\x86q\xe2\x87}\xba+\xe4\x87\xaf~"
)
assert mmh3.hash_bytes("foo", 0, x64arch=False) == b"%\x1b|We%\xb6`e%\xb6`e%\xb6`"
# TODO


Expand Down

0 comments on commit 300f8e5

Please sign in to comment.