Gets the value of a key, or sets it to a default if the key doesn't exist.
(self, key: str, default: Any = None)
| 102 | return key in self._value or key in self._delta |
| 103 | |
| 104 | def setdefault(self, key: str, default: Any = None) -> Any: |
| 105 | """Gets the value of a key, or sets it to a default if the key doesn't exist.""" |
| 106 | if key in self: |
| 107 | return self[key] |
| 108 | else: |
| 109 | self[key] = default |
| 110 | return default |
| 111 | |
| 112 | def has_delta(self) -> bool: |
| 113 | """Whether the state has pending delta.""" |
no outgoing calls