Skip to content

Commit

Permalink
fixed py37
Browse files Browse the repository at this point in the history
  • Loading branch information
fametrano committed Jan 2, 2023
1 parent 9a10913 commit e4678a4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion btclib/alias.py
Expand Up @@ -16,6 +16,8 @@
from io import BytesIO
from typing import Any, Callable, Tuple, Union

from typing_extensions import TypeAlias

# Octets are a sequence of eight-bit bytes or a hex-string (not text string)
#
# hex-strings are strings that can be converted to bytes using bytes.fromhex,
Expand Down Expand Up @@ -75,7 +77,7 @@

# Elliptic curve point in affine coordinates.
# Warning: to make Point a NamedTuple would slow down the code
Point = Tuple[int, int]
Point: TypeAlias = Tuple[int, int]

# Note that the infinity point in affine coordinates is INF = (int, 0)
# (no affine point has y=0 coordinate in a group of prime order).
Expand Down
2 changes: 1 addition & 1 deletion btclib/script/script.py
Expand Up @@ -374,7 +374,7 @@ class Script:
def asm(self) -> List[Command]:
return parse(self.script)

def __add__(self, other: object):
def __add__(self, other: object) -> object:

return (
Script(self.script + other.script)
Expand Down
6 changes: 4 additions & 2 deletions btclib/to_prv_key.py
Expand Up @@ -11,9 +11,11 @@
"Functions for conversions between different private key formats."

import contextlib
from typing import Optional, Tuple, TypeAlias
from typing import Optional, Tuple, Union

from btclib.alias import String, Union
from typing_extensions import TypeAlias

from btclib.alias import String
from btclib.base58 import b58decode
from btclib.bip32 import BIP32Key, BIP32KeyData
from btclib.ec import Curve, secp256k1
Expand Down
4 changes: 3 additions & 1 deletion btclib/to_pub_key.py
Expand Up @@ -11,7 +11,9 @@
"Functions for conversions between different public key formats."

import contextlib
from typing import Optional, Tuple, TypeAlias, Union
from typing import Optional, Tuple, Union

from typing_extensions import TypeAlias

from btclib.alias import Point
from btclib.bip32 import BIP32Key, BIP32KeyData
Expand Down

0 comments on commit e4678a4

Please sign in to comment.