MCPcopy Index your code
hub / github.com/reactive-python/reactpy / unset

Method unset

src/py/reactpy/reactpy/_option.py:124–134  ·  view source on GitHub ↗

Remove the current value, the default will be used until it is set again.

(self)

Source from the content-addressed store, hash-verified

122 self.set_current(os.environ.get(self._name, self._default))
123
124 def unset(self) -> None:
125 """Remove the current value, the default will be used until it is set again."""
126 if not self._mutable:
127 msg = f"{self} cannot be modified after initial load"
128 raise TypeError(msg)
129 old = self.current
130 if hasattr(self, "_current"):
131 delattr(self, "_current")
132 if self.current != old:
133 for sub_func in self._subscribers:
134 sub_func(self.current)
135
136 def __repr__(self) -> str:
137 return f"Option({self._name}={self.current!r})"

Callers 5

test_immutable_optionFunction · 0.95
test_option_resetFunction · 0.95
test_option_subscribeFunction · 0.95
currentMethod · 0.95
reset_optionsFunction · 0.80

Calls

no outgoing calls

Tested by 4

test_immutable_optionFunction · 0.76
test_option_resetFunction · 0.76
test_option_subscribeFunction · 0.76
reset_optionsFunction · 0.64