str-to-obj 2025.1__tar.gz → 2025.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {str_to_obj-2025.1 → str_to_obj-2025.2}/PKG-INFO +1 -1
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/main.py +16 -20
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/type/hint_tree.py +1 -1
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/version.py +1 -1
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj.egg-info/PKG-INFO +1 -1
- {str_to_obj-2025.1 → str_to_obj-2025.2}/MANIFEST.in +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/README-COPYRIGHT-utf8.txt +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/README-LICENCE-utf8.txt +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/README.rst +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/documentation/wiki/description.asciidoc +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/__init__.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/api/catalog.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/api/type.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/catalog/boolean.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/catalog/callable.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/catalog/choices.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/catalog/collection.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/catalog/number.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/catalog/path.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/interface/console.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/runtime/type.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/runtime/value.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/task/casting.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/task/comparison.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/task/inspection.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/type/annotation.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/type/hint.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/type/type.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj/type/value.py +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj.egg-info/SOURCES.txt +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj.egg-info/dependency_links.txt +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj.egg-info/requires.txt +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/package/str_to_obj.egg-info/top_level.txt +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/pyproject.toml +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/requirements.txt +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/setup.cfg +0 -0
- {str_to_obj-2025.1 → str_to_obj-2025.2}/setup.py +0 -0
@@ -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
|
"""
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|