From 8311f4144843ce9ee76a293d2012912c2bcafe7c Mon Sep 17 00:00:00 2001 From: barrust Date: Mon, 23 Dec 2024 20:39:33 -0500 Subject: [PATCH] use type aliases --- probables/hashes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/probables/hashes.py b/probables/hashes.py index 0fa2e8a..d221b0c 100644 --- a/probables/hashes.py +++ b/probables/hashes.py @@ -3,15 +3,15 @@ from functools import wraps from hashlib import md5, sha256 from struct import unpack -from typing import Callable, List, Union +from typing import Callable, List, TypeAlias, Union from probables.constants import UINT32_T_MAX, UINT64_T_MAX -KeyT = Union[str, bytes] -SimpleHashT = Callable[[KeyT, int], int] -HashResultsT = List[int] -HashFuncT = Callable[[KeyT, int], HashResultsT] -HashFuncBytesT = Callable[[KeyT, int], bytes] +KeyT: TypeAlias = Union[str, bytes] +SimpleHashT: TypeAlias = Callable[[KeyT, int], int] +HashResultsT: TypeAlias = List[int] +HashFuncT: TypeAlias = Callable[[KeyT, int], HashResultsT] +HashFuncBytesT: TypeAlias = Callable[[KeyT, int], bytes] def hash_with_depth_bytes(func: HashFuncBytesT) -> HashFuncT: