dynos-core 0.2.0__tar.gz → 0.2.2__tar.gz
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.
- {dynos_core-0.2.0 → dynos_core-0.2.2}/PKG-INFO +1 -1
- {dynos_core-0.2.0 → dynos_core-0.2.2}/pyproject.toml +1 -1
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/factories.py +21 -9
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core.egg-info/PKG-INFO +1 -1
- {dynos_core-0.2.0 → dynos_core-0.2.2}/README.md +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/setup.cfg +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/__init__.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/atom.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/backoff.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/extension.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/state.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/time_parse.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/transition.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core/types.py +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core.egg-info/SOURCES.txt +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core.egg-info/dependency_links.txt +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core.egg-info/requires.txt +0 -0
- {dynos_core-0.2.0 → dynos_core-0.2.2}/src/dynos_core.egg-info/top_level.txt +0 -0
|
@@ -53,6 +53,21 @@ def _infer_name_from_assignment() -> Optional[str]:
|
|
|
53
53
|
return None
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
def generate_object_name(type_name: str) -> str:
|
|
57
|
+
"""Mint a unique, type-prefixed object name.
|
|
58
|
+
|
|
59
|
+
The shared fallback for when a domain object is created without an explicit
|
|
60
|
+
name and no assignment target can be inferred (the HTTP/servant paths, where
|
|
61
|
+
there is no ``lhs = make_new_object(...)`` source line to read). The type
|
|
62
|
+
prefix keeps the name readable and -- crucially -- distinct from the bare
|
|
63
|
+
type name: an object named after its own type collides with the type in the
|
|
64
|
+
planning problem (they share one namespace) and fails at plan time.
|
|
65
|
+
"""
|
|
66
|
+
from uuid import uuid4
|
|
67
|
+
|
|
68
|
+
return f"{type_name}_{uuid4().hex[:8]}"
|
|
69
|
+
|
|
70
|
+
|
|
56
71
|
class FluentBase:
|
|
57
72
|
"""Client-side fluent: calling it returns a GroundAtom.
|
|
58
73
|
|
|
@@ -145,13 +160,10 @@ def make_new_object(type_cls: Any, name: Optional[str] = None, **values: Any) ->
|
|
|
145
160
|
if name is None:
|
|
146
161
|
name = _infer_name_from_assignment()
|
|
147
162
|
if not isinstance(name, str) or not name:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"name='your_name' explicitly or wrap the call in a single-target "
|
|
155
|
-
"assignment like `your_name = make_new_object(...)`."
|
|
156
|
-
)
|
|
163
|
+
# No explicit name and no inferable assignment target (comprehension,
|
|
164
|
+
# tuple-unpack, interactive, or a wire/servant caller). Mint a unique
|
|
165
|
+
# type-prefixed name rather than failing -- the same fallback the client
|
|
166
|
+
# create path uses, so an unnamed object always gets a usable, distinct
|
|
167
|
+
# identity instead of a collision-prone bare type name.
|
|
168
|
+
name = generate_object_name(type_name)
|
|
157
169
|
return SymbolicObject(name=name, type_name=type_name)
|
|
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
|