str-to-obj 2025.1__py3-none-any.whl → 2025.2__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/main.py +16 -20
- str_to_obj/type/hint_tree.py +1 -1
- str_to_obj/version.py +1 -1
- {str_to_obj-2025.1.dist-info → str_to_obj-2025.2.dist-info}/METADATA +1 -1
- {str_to_obj-2025.1.dist-info → str_to_obj-2025.2.dist-info}/RECORD +7 -7
- {str_to_obj-2025.1.dist-info → str_to_obj-2025.2.dist-info}/WHEEL +0 -0
- {str_to_obj-2025.1.dist-info → str_to_obj-2025.2.dist-info}/top_level.txt +0 -0
str_to_obj/main.py
CHANGED
@@ -29,11 +29,7 @@ def ObjectFromStr(
|
|
29
29
|
issues = [f'{string}: Invalid value; Expected="NONE" or "None" or "none".']
|
30
30
|
return None, issues
|
31
31
|
|
32
|
-
|
33
|
-
try:
|
34
|
-
value = bstr.literal_eval(string)
|
35
|
-
except (SyntaxError, ValueError):
|
36
|
-
value = string
|
32
|
+
value = _ObjectFromStr(string)
|
37
33
|
|
38
34
|
if expected_type is None:
|
39
35
|
return value, []
|
@@ -41,21 +37,21 @@ def ObjectFromStr(
|
|
41
37
|
return CastValue(value, expected_type)
|
42
38
|
|
43
39
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
40
|
+
def _ObjectFromStr(string: str | h.Any, /)-> h.Any:
|
41
|
+
""""""
|
42
|
+
if not isinstance(string, str):
|
43
|
+
return string
|
44
|
+
|
45
|
+
try:
|
46
|
+
value = bstr.literal_eval(string)
|
47
|
+
except (SyntaxError, ValueError):
|
48
|
+
value = string
|
49
|
+
|
50
|
+
if isinstance(value, h.Sequence) and not isinstance(value, str):
|
51
|
+
stripe = type(value)
|
52
|
+
value = stripe(_ObjectFromStr(_elm) for _elm in value)
|
53
|
+
|
54
|
+
return value
|
59
55
|
|
60
56
|
|
61
57
|
"""
|
str_to_obj/type/hint_tree.py
CHANGED
@@ -112,7 +112,7 @@ class hint_t(_hint_node_t):
|
|
112
112
|
return output
|
113
113
|
|
114
114
|
@property
|
115
|
-
def template(self) ->
|
115
|
+
def template(self) -> type[_hint_node_t.type] | dict[int, h.Any] | None:
|
116
116
|
""""""
|
117
117
|
if self.type is t.NoneType:
|
118
118
|
return None
|
str_to_obj/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
str_to_obj/__init__.py,sha256=R22_7BvT9x1iJjVZzl1MraNV1TR73TBxnmiYasVp_Kw,2645
|
2
|
-
str_to_obj/main.py,sha256=
|
3
|
-
str_to_obj/version.py,sha256=
|
2
|
+
str_to_obj/main.py,sha256=oxAWYP1tlED9Xk-GXJ45H_fUFYN9aNAOVK8rIvMd5dM,3441
|
3
|
+
str_to_obj/version.py,sha256=CixOc5Gh49sHYp1OL_5l6s9wqCJrmwTn2z9yGLYGnhQ,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
|
@@ -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=cYudLQ88C5y_vhxeJVa_CH4rRTa8L8Ljnc4BxDgpUEQ,7905
|
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.2.dist-info/METADATA,sha256=V-AEcQMJ6eeSbX72BQite4t136pIuX277LOETfudhmY,6717
|
24
|
+
str_to_obj-2025.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
25
|
+
str_to_obj-2025.2.dist-info/top_level.txt,sha256=h-6bR_TAnXRGVSLTeNPlivlaG64xYM3E__Xg7sCgeug,11
|
26
|
+
str_to_obj-2025.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|