str-to-obj 2025.2__py3-none-any.whl → 2025.4__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.
- str_to_obj/catalog/collection.py +6 -6
- str_to_obj/catalog/number.py +7 -7
- str_to_obj/type/hint_tree.py +4 -3
- str_to_obj/version.py +1 -1
- {str_to_obj-2025.2.dist-info → str_to_obj-2025.4.dist-info}/METADATA +1 -1
- {str_to_obj-2025.2.dist-info → str_to_obj-2025.4.dist-info}/RECORD +8 -8
- {str_to_obj-2025.2.dist-info → str_to_obj-2025.4.dist-info}/WHEEL +0 -0
- {str_to_obj-2025.2.dist-info → str_to_obj-2025.4.dist-info}/top_level.txt +0 -0
str_to_obj/catalog/collection.py
CHANGED
@@ -8,7 +8,7 @@ import dataclasses as d
|
|
8
8
|
import types as t
|
9
9
|
import typing as h
|
10
10
|
|
11
|
-
from logger_36 import
|
11
|
+
from logger_36 import L
|
12
12
|
from str_to_obj.type.annotation import annotation_t
|
13
13
|
from str_to_obj.type.hint import any_hint_h
|
14
14
|
from str_to_obj.type.type import type_t
|
@@ -48,10 +48,10 @@ class collection_t(annotation_t):
|
|
48
48
|
else:
|
49
49
|
self.lengths = tuple(sorted(self.lengths))
|
50
50
|
|
51
|
-
with
|
51
|
+
with L.AddedContextLevel("Collection Annotation"):
|
52
52
|
if isinstance(self.items_types, h.Sequence):
|
53
53
|
if max(self.lengths) > self.items_types.__len__():
|
54
|
-
|
54
|
+
L.StageIssue(
|
55
55
|
f'Allowed length(s) ("{original_lengths}") must not exceed '
|
56
56
|
f"the length of the item types sequence "
|
57
57
|
f'("{original_item_types}")'
|
@@ -59,7 +59,7 @@ class collection_t(annotation_t):
|
|
59
59
|
if self.lengths != self.__class__.ANY_LENGTH:
|
60
60
|
for length in self.lengths:
|
61
61
|
if (not isinstance(length, int)) or (length < 0):
|
62
|
-
|
62
|
+
L.StageIssue(
|
63
63
|
f"Invalid length in {self.lengths}",
|
64
64
|
actual=length,
|
65
65
|
expected="strictly positive integer",
|
@@ -76,8 +76,8 @@ class collection_t(annotation_t):
|
|
76
76
|
stripe = type_t.NewForHint(stripe)
|
77
77
|
|
78
78
|
if stripe.type not in cls.ACCEPTED_TYPES:
|
79
|
-
with
|
80
|
-
|
79
|
+
with L.AddedContextLevel("Collection Annotation"):
|
80
|
+
L.StageIssue(
|
81
81
|
f"Invalid type",
|
82
82
|
actual=stripe.type.__name__,
|
83
83
|
expected=", ".join(_elm.__name__ for _elm in cls.ACCEPTED_TYPES),
|
str_to_obj/catalog/number.py
CHANGED
@@ -7,7 +7,7 @@ SEE COPYRIGHT NOTICE BELOW
|
|
7
7
|
import dataclasses as d
|
8
8
|
import typing as h
|
9
9
|
|
10
|
-
from logger_36 import
|
10
|
+
from logger_36 import L
|
11
11
|
from str_to_obj.type.annotation import annotation_t
|
12
12
|
|
13
13
|
number_h = int | float
|
@@ -30,11 +30,11 @@ class number_t(annotation_t):
|
|
30
30
|
""""""
|
31
31
|
stripe = self.__class__
|
32
32
|
|
33
|
-
with
|
33
|
+
with L.AddedContextLevel("Number Annotation"):
|
34
34
|
if (self.min != stripe.INFINITY_NEG) and not isinstance(
|
35
35
|
self.min, number_h.__args__
|
36
36
|
):
|
37
|
-
|
37
|
+
L.StageIssue(
|
38
38
|
f"Invalid type for min value {self.min}",
|
39
39
|
actual=type(self.min).__name__,
|
40
40
|
expected=number_h,
|
@@ -42,7 +42,7 @@ class number_t(annotation_t):
|
|
42
42
|
if (self.max != stripe.INFINITY_POS) and not isinstance(
|
43
43
|
self.max, number_h.__args__
|
44
44
|
):
|
45
|
-
|
45
|
+
L.StageIssue(
|
46
46
|
f"Invalid type for max value {self.max}",
|
47
47
|
actual=type(self.max).__name__,
|
48
48
|
expected=number_h,
|
@@ -50,13 +50,13 @@ class number_t(annotation_t):
|
|
50
50
|
if (self.precision != stripe.INFINITE_PRECISION) and not isinstance(
|
51
51
|
self.precision, number_h.__args__
|
52
52
|
):
|
53
|
-
|
53
|
+
L.StageIssue(
|
54
54
|
f"Invalid type for precision {self.precision}",
|
55
55
|
actual=type(self.precision).__name__,
|
56
56
|
expected=number_h,
|
57
57
|
)
|
58
58
|
if self.precision < 0:
|
59
|
-
|
59
|
+
L.StageIssue(f"Invalid, negative precision {self.precision}")
|
60
60
|
if (self.min > self.max) or (
|
61
61
|
(self.min == self.max)
|
62
62
|
and not (self.min_inclusive and self.max_inclusive)
|
@@ -69,7 +69,7 @@ class number_t(annotation_t):
|
|
69
69
|
closing = "]"
|
70
70
|
else:
|
71
71
|
closing = "["
|
72
|
-
|
72
|
+
L.StageIssue(
|
73
73
|
f"Empty value interval {opening}{self.min},{self.max}{closing}"
|
74
74
|
)
|
75
75
|
|
str_to_obj/type/hint_tree.py
CHANGED
@@ -17,9 +17,10 @@ from str_to_obj.type.hint import (
|
|
17
17
|
any_hint_h,
|
18
18
|
complex_hint_additions_h,
|
19
19
|
non_complex_hint_h,
|
20
|
-
simple_hint_h,
|
21
20
|
)
|
22
21
|
|
22
|
+
hint_node_type_h = non_complex_hint_h | t.UnionType | t.EllipsisType | type[t.NoneType]
|
23
|
+
|
23
24
|
|
24
25
|
@d.dataclass(slots=True, repr=False, eq=False)
|
25
26
|
class _hint_node_t:
|
@@ -29,7 +30,7 @@ class _hint_node_t:
|
|
29
30
|
otherwise.
|
30
31
|
"""
|
31
32
|
|
32
|
-
type:
|
33
|
+
type: hint_node_type_h
|
33
34
|
annotations: tuple[annotation_t, ...] = d.field(default_factory=tuple)
|
34
35
|
literal_s: tuple[h.Any, ...] | None = None
|
35
36
|
|
@@ -112,7 +113,7 @@ class hint_t(_hint_node_t):
|
|
112
113
|
return output
|
113
114
|
|
114
115
|
@property
|
115
|
-
def template(self) -> type[
|
116
|
+
def template(self) -> type[hint_node_type_h] | dict[int, h.Any] | None:
|
116
117
|
""""""
|
117
118
|
if self.type is t.NoneType:
|
118
119
|
return None
|
str_to_obj/version.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
str_to_obj/__init__.py,sha256=R22_7BvT9x1iJjVZzl1MraNV1TR73TBxnmiYasVp_Kw,2645
|
2
2
|
str_to_obj/main.py,sha256=oxAWYP1tlED9Xk-GXJ45H_fUFYN9aNAOVK8rIvMd5dM,3441
|
3
|
-
str_to_obj/version.py,sha256=
|
3
|
+
str_to_obj/version.py,sha256=IbTJ6S67wmByym-i0UGSnaE3XmgqF2EpFjhjOpi58Qk,2206
|
4
4
|
str_to_obj/api/catalog.py,sha256=6ka6JciGdHFP93lg0yq2LO3iZBHfq0upZfXxQSg1izk,2521
|
5
5
|
str_to_obj/api/type.py,sha256=yxD5wTtnh_h8Wa9_k1eex-nrkjtfh4ZJI6Db6hJHI9w,2468
|
6
6
|
str_to_obj/catalog/boolean.py,sha256=G2ZkLqf1e3cpMzjiGgd3E0aAVs6_xlpzG3U2LiOFbio,3508
|
7
7
|
str_to_obj/catalog/callable.py,sha256=NCoogYzVBUSqiYEj_DoG-szqQdnYhvSj0xdyvg1W7Jw,3626
|
8
8
|
str_to_obj/catalog/choices.py,sha256=eZp_id2gWxgnzw7_RVEgy01s86c0Ci4MbRFZsRJMjJ8,3855
|
9
|
-
str_to_obj/catalog/collection.py,sha256=
|
10
|
-
str_to_obj/catalog/number.py,sha256=
|
9
|
+
str_to_obj/catalog/collection.py,sha256=QIM8KmMrzodqKL_cfo6LutXYhFRvsumvQYIG9tL6Ie0,6737
|
10
|
+
str_to_obj/catalog/number.py,sha256=izzA_yhKxbvUmklEBLZXtRrKPMsndt-vR2abIL-x4t0,5426
|
11
11
|
str_to_obj/catalog/path.py,sha256=xBrQJ-RMH-y_oaWP-uUTSpIKcL2vrtXoqrSaaS4HRpg,3857
|
12
12
|
str_to_obj/interface/console.py,sha256=t_prEhOHOOtsIld5orw2sIfaDjiy_kEO5Xy3Hr0Js3g,3037
|
13
13
|
str_to_obj/runtime/type.py,sha256=IGgBgvYu5QrxWKiEEwg5Hn1DNLYZrm6VX7b1o6_OMCI,2288
|
@@ -17,10 +17,10 @@ str_to_obj/task/comparison.py,sha256=HBzv7gBtOnROsC6Sq-FYpgd_MKzVJreboNiqkza3vJ8
|
|
17
17
|
str_to_obj/task/inspection.py,sha256=M8YnYq4A_Zz7rC2kgTYSSSawTnG2dCug5FBoCOBJ5g8,3127
|
18
18
|
str_to_obj/type/annotation.py,sha256=xXShME2Q344N3QlsqKtU6ttne54tTVC3b62CHU1TGUM,3838
|
19
19
|
str_to_obj/type/hint.py,sha256=w-yos8eD4CHQsXPfnqeqAc-ozyDWqzw46FOWDtAh7dM,2810
|
20
|
-
str_to_obj/type/hint_tree.py,sha256=
|
20
|
+
str_to_obj/type/hint_tree.py,sha256=DA69tIjrjQixPcLQCgI3MEnbIPDsRRNNYOb0SLA3pUI,7922
|
21
21
|
str_to_obj/type/type.py,sha256=ywc7GpzM1BsoQ3F0qk4wZ2DG1KZllw-PNv_umIGt8hA,4147
|
22
22
|
str_to_obj/type/value.py,sha256=r9Ko5HHant1JGbsO7vH1unRBr9guc61Jz2piuJT0BjM,2533
|
23
|
-
str_to_obj-2025.
|
24
|
-
str_to_obj-2025.
|
25
|
-
str_to_obj-2025.
|
26
|
-
str_to_obj-2025.
|
23
|
+
str_to_obj-2025.4.dist-info/METADATA,sha256=oTnlupDF4aEqFNrvRp3hYgjzjL9YagDorGdFMfafnrM,6717
|
24
|
+
str_to_obj-2025.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
25
|
+
str_to_obj-2025.4.dist-info/top_level.txt,sha256=h-6bR_TAnXRGVSLTeNPlivlaG64xYM3E__Xg7sCgeug,11
|
26
|
+
str_to_obj-2025.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|