tsrkit-types 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tsrkit_types/integers.py +8 -7
- {tsrkit_types-0.1.5.dist-info → tsrkit_types-0.1.6.dist-info}/METADATA +1 -1
- {tsrkit_types-0.1.5.dist-info → tsrkit_types-0.1.6.dist-info}/RECORD +6 -6
- {tsrkit_types-0.1.5.dist-info → tsrkit_types-0.1.6.dist-info}/WHEEL +0 -0
- {tsrkit_types-0.1.5.dist-info → tsrkit_types-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {tsrkit_types-0.1.5.dist-info → tsrkit_types-0.1.6.dist-info}/top_level.txt +0 -0
tsrkit_types/integers.py
CHANGED
|
@@ -53,9 +53,9 @@ class Int(int, Codable, metaclass=IntCheckMeta):
|
|
|
53
53
|
# Otherwise, the integer is General Integer (supports up to 2**64 - 1)
|
|
54
54
|
byte_size: int = 0
|
|
55
55
|
signed = False
|
|
56
|
-
_bound =
|
|
56
|
+
_bound = 1 << 64
|
|
57
57
|
|
|
58
|
-
def __class_getitem__(cls, data: int | tuple):
|
|
58
|
+
def __class_getitem__(cls, data: int | tuple | bool | None):
|
|
59
59
|
"""
|
|
60
60
|
Args:
|
|
61
61
|
data: either byte_size or (byte_size, signed)
|
|
@@ -69,7 +69,8 @@ class Int(int, Codable, metaclass=IntCheckMeta):
|
|
|
69
69
|
else:
|
|
70
70
|
size, signed = 0, bool(data)
|
|
71
71
|
else:
|
|
72
|
-
size, signed = data
|
|
72
|
+
size, signed = data
|
|
73
|
+
|
|
73
74
|
return type(f"U{size}" if size else "Int", (cls,), {
|
|
74
75
|
"byte_size": size // 8,
|
|
75
76
|
"signed": signed,
|
|
@@ -238,7 +239,7 @@ class Int(int, Codable, metaclass=IntCheckMeta):
|
|
|
238
239
|
|
|
239
240
|
|
|
240
241
|
Uint = Int
|
|
241
|
-
U8 =
|
|
242
|
-
U16 =
|
|
243
|
-
U32 =
|
|
244
|
-
U64 =
|
|
242
|
+
U8 = Int[8]
|
|
243
|
+
U16 = Int[16]
|
|
244
|
+
U32 = Int[32]
|
|
245
|
+
U64 = Int[64]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tsrkit-types
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Performant Python Typings library for type-safe binary serialization, JSON encoding, and data validation with zero dependencies
|
|
5
5
|
Author-email: chainscore-labs <hello@chainscore.finance>, prasad-kumkar <prasad@chainscore.finance>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -7,15 +7,15 @@ tsrkit_types/bytes_common.py,sha256=b1Zqh_NhkCX718QaZC52J3nEzKAi1Fe8E0nefWVwwmo,
|
|
|
7
7
|
tsrkit_types/choice.py,sha256=OVHxIr2PcnaTpo5sAMjipCArc5oATNsyYkqZNRqU7bA,5253
|
|
8
8
|
tsrkit_types/dictionary.py,sha256=GcUvaHC1VOEc3OzUVAH0id--ncLqTJ6ZRz-lucMNRdY,5618
|
|
9
9
|
tsrkit_types/enum.py,sha256=3MyLW15_ToQQdctJjcMY8Xb3OsS_Ad997OOEo8FjVeA,4256
|
|
10
|
-
tsrkit_types/integers.py,sha256=
|
|
10
|
+
tsrkit_types/integers.py,sha256=OARdkz7j06xCU2AZz4_RciR1hVexSnF1tAQ3HQGNZI8,8858
|
|
11
11
|
tsrkit_types/null.py,sha256=vzobz4-xJrUeky8pzbg-Qmz4N6b7GsCNf8TafbstlgY,1372
|
|
12
12
|
tsrkit_types/option.py,sha256=xwtaAFN20GjaGqzYZAAo1fZqqUZnCYHdy2bjshhY620,1631
|
|
13
13
|
tsrkit_types/sequences.py,sha256=KOT5-4mia5Lc0CMjIF7Yqe34Sei92ZQ2s6GaP13soUg,8090
|
|
14
14
|
tsrkit_types/string.py,sha256=8rvg0BwvyhQnbMW3qornmBFTQHeTQFUfwD7OC0eVgcY,2575
|
|
15
15
|
tsrkit_types/struct.py,sha256=GoXWFc1OqO9CXnxFS7Xkms7J-rtZe8h32LkAIBlzdSM,3497
|
|
16
16
|
tsrkit_types/itf/codable.py,sha256=agx8YSVWGBeEiLrU9eqh3ZoeTgpJsmmIlW622xIKqPI,2810
|
|
17
|
-
tsrkit_types-0.1.
|
|
18
|
-
tsrkit_types-0.1.
|
|
19
|
-
tsrkit_types-0.1.
|
|
20
|
-
tsrkit_types-0.1.
|
|
21
|
-
tsrkit_types-0.1.
|
|
17
|
+
tsrkit_types-0.1.6.dist-info/licenses/LICENSE,sha256=TwnDvVCPwHadHWLUuY1sPx03XNw1jzh_ZmoDBNai9Uc,1072
|
|
18
|
+
tsrkit_types-0.1.6.dist-info/METADATA,sha256=JLEqIyXYIju0AqWihQakM593qyyKNvdMjuTCVo9CKBI,22755
|
|
19
|
+
tsrkit_types-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
20
|
+
tsrkit_types-0.1.6.dist-info/top_level.txt,sha256=pnVhnUsnZ_A0FIj1zHwDw3suMGrfMJwusp-4GPVY1CM,13
|
|
21
|
+
tsrkit_types-0.1.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|