Skip to content

Commit

Permalink
fix: type hints like list[str] not support in python38
Browse files Browse the repository at this point in the history
  • Loading branch information
olivmath committed Dec 31, 2023
1 parent fef5290 commit 9a698a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions merkly/mtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
12 changes: 6 additions & 6 deletions merkly/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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])
Expand Down

0 comments on commit 9a698a5

Please sign in to comment.