14
14
# limitations under the License.
15
15
16
16
from abc import ABC
17
+ from typing import Tuple
17
18
# internal
18
19
from .exception import ClientException
19
20
@@ -36,7 +37,7 @@ def get_param_count(self) -> int:
36
37
37
38
38
39
class SkyhashParameter (ABC ):
39
- def encode_self (self ) -> tuple [bytes , int ]: pass
40
+ def encode_self (self ) -> Tuple [bytes , int ]: pass
40
41
41
42
42
43
class UInt (SkyhashParameter ):
@@ -45,19 +46,19 @@ def __init__(self, v: int) -> None:
45
46
raise ClientException ("unsigned int can't be negative" )
46
47
self .v = v
47
48
48
- def encode_self (self ) -> tuple [bytes , int ]:
49
+ def encode_self (self ) -> Tuple [bytes , int ]:
49
50
return (f"\x02 { self .v } \n " .encode (), 1 )
50
51
51
52
52
53
class SInt (SkyhashParameter ):
53
54
def __init__ (self , v : int ) -> None :
54
55
self .v = v
55
56
56
- def encode_self (self ) -> tuple [bytes , int ]:
57
+ def encode_self (self ) -> Tuple [bytes , int ]:
57
58
return (f"\x03 { self .v } \n " .encode (), 1 )
58
59
59
60
60
- def encode_parameter (parameter : any ) -> tuple [bytes , int ]:
61
+ def encode_parameter (parameter : any ) -> Tuple [bytes , int ]:
61
62
encoded = None
62
63
if isinstance (parameter , SkyhashParameter ):
63
64
return parameter .encode_self ()
0 commit comments