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