Updates the state dict with the given delta.
(self, delta: dict[str, Any])
| 120 | return self[key] |
| 121 | |
| 122 | def update(self, delta: dict[str, Any]) -> None: |
| 123 | """Updates the state dict with the given delta.""" |
| 124 | if self._schema is not None and isinstance(self._schema, type): |
| 125 | for key, value in delta.items(): |
| 126 | _validate_state_entry(self._schema, key, value) |
| 127 | self._value.update(delta) |
| 128 | self._delta.update(delta) |
| 129 | |
| 130 | def to_dict(self) -> dict[str, Any]: |
| 131 | """Returns the state dict.""" |