diff --git a/src/spox/_fields.py b/src/spox/_fields.py index ef20a50..d848665 100644 --- a/src/spox/_fields.py +++ b/src/spox/_fields.py @@ -8,7 +8,7 @@ import warnings from collections.abc import Iterable, Iterator, Sequence from dataclasses import dataclass -from typing import Any, Optional, Union, cast +from typing import Optional, Union, cast from ._attributes import Attr from ._exceptions import InferenceWarning @@ -76,14 +76,6 @@ def __setattr__(self, attr: str, value: Union[Var, Sequence[Var]]) -> None: else: self.vars[attr] = value - def __getitem__(self, key: str): - """Allows dictionary-like access to retrieve variables.""" - return self.vars[key] - - def __setitem__(self, key: str, value: Union) -> None: - """Allows dictionary-like access to set variables.""" - self.vars[key] = value - @dataclass class BaseVarInfos(BaseFields): @@ -147,10 +139,6 @@ def get_fields(self) -> dict[str, Union[None, _VarInfo, Sequence[_VarInfo]]]: """Return a mapping of all fields stored in this object by name.""" return self.__dict__.copy() - def _unpack_to_any(self) -> Any: - """Unpack the stored fields into a tuple of appropriate length, typed as Any.""" - return tuple(self.__dict__.values()) - @property def fully_typed(self) -> bool: """Check if all stored variables have a concrete type.""" diff --git a/tests/test_function.py b/tests/test_function.py index a02568c..9933f61 100644 --- a/tests/test_function.py +++ b/tests/test_function.py @@ -151,7 +151,7 @@ class Outputs(BaseOutputs): outputs: Outputs def constructor(self, attrs: dict[str, Attr], inputs: BaseVars) -> Outputs: - x = inputs["X"] + x = inputs.X a = op.mul( linear( x,