MCPcopy Create free account
hub / github.com/dot-agent/nextpy / ComputedState

Class ComputedState

tests/test_state.py:1083–1090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1081 comp_v_calls = 0
1082
1083 class ComputedState(BaseState):
1084 v: int = 0
1085
1086 @xt.cached_var
1087 def comp_v(self) -> int:
1088 nonlocal comp_v_calls
1089 comp_v_calls += 1
1090 return self.v
1091
1092 cs = ComputedState()
1093 assert cs.dict()[cs.get_full_name()]["v"] == 0

Calls

no outgoing calls