Remove the current value, the default will be used until it is set again.
(self)
| 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})" |
no outgoing calls