From 9a698a536529c9dca846c9d81428b1534f613d3f Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Sun, 31 Dec 2023 02:24:03 -0300 Subject: [PATCH] fix: type hints like list[str] not support in python38 --- merkly/mtree.py | 4 ++-- merkly/utils.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/merkly/mtree.py b/merkly/mtree.py index 997d21b..dc15319 100644 --- a/merkly/mtree.py +++ b/merkly/mtree.py @@ -167,9 +167,9 @@ def up_layer(self, leaves: List[bytes]) -> List[bytes]: return new_layer @property - def human_leaves(self) -> list[str]: + def human_leaves(self) -> List[str]: return [leaf.hex() for leaf in self.leaves] @property - def human_short_leaves(self) -> list[str]: + def human_short_leaves(self) -> List[str]: return [leaf.hex() for leaf in self.short_leaves] diff --git a/merkly/utils.py b/merkly/utils.py index d7eb232..4522666 100644 --- a/merkly/utils.py +++ b/merkly/utils.py @@ -52,9 +52,9 @@ def keccak(data: bytes) -> bytes: def half(list_item: List[int]) -> Tuple[int, int]: """ - # Slice a `x: list[int]` in a pairs - - params `x: list[int]` - - return `list: list[list[int]] + # Slice a `x: List[int]` in a pairs + - params `x: List[int]` + - return `list: List[List[int]] ```python >>> slicer([1,2,3,4]) @@ -72,9 +72,9 @@ def half(list_item: List[int]) -> Tuple[int, int]: def slice_in_pairs(list_item: list): """ - # Slice a `x: list[int]` in pairs, pairs is sublist of 2 items - - params `x: list[int]` - - return `list: list[list[int]] + # Slice a `x: List[int]` in pairs, pairs is sublist of 2 items + - params `x: List[int]` + - return `list: List[List[int]] ```python >>> slicer([1,2,3,4])