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

Method set_default

src/py/reactpy/reactpy/_option.py:111–118  ·  view source on GitHub ↗

Set the value of this option if not :meth:`Option.is_set` Returns the current value (a la :meth:`dict.set_default`)

(self, new: _O)

Source from the content-addressed store, hash-verified

109 sub_func(new)
110
111 def set_default(self, new: _O) -> _O:
112 """Set the value of this option if not :meth:`Option.is_set`
113
114 Returns the current value (a la :meth:`dict.set_default`)
115 """
116 if not self.is_set():
117 self.set_current(new)
118 return self._current
119
120 def reload(self) -> None:
121 """Reload this option from its environment variable"""

Callers 1

test_option_set_defaultFunction · 0.95

Calls 2

is_setMethod · 0.95
set_currentMethod · 0.95

Tested by 1

test_option_set_defaultFunction · 0.76