add extra fields to Field datatype

Signed-off-by: varun-r-mallya <varunrmallya@gmail.com>
This commit is contained in:
2025-10-11 22:28:23 +05:30
parent 75d3ad4fe2
commit 3343bedd11

View File

@ -8,6 +8,8 @@ class Field:
name: str
type: type
containing_type: Optional[Any]
type_size: Optional[int]
value: Any = None
ready: bool = False
@ -75,11 +77,18 @@ class DependencyNode:
name: str,
field_type: type,
initial_value: Any = None,
containing_type: Optional[Any] = None,
type_size: Optional[int] = None,
ready: bool = False,
) -> None:
"""Add a field to the node with an optional initial value and readiness state."""
self.fields[name] = Field(
name=name, type=field_type, value=initial_value, ready=ready
name=name,
type=field_type,
value=initial_value,
ready=ready,
containing_type=containing_type,
type_size=type_size,
)
# Invalidate readiness cache
self._ready_cache = None