Get value for a key with optional default. Args: key: The key to look up. default: Value to return if key not found (default: None). Returns: The value associated with the key, or default if not found.
(self, key: Any, default: Any = None)
| 219 | return value |
| 220 | |
| 221 | def get(self, key: Any, default: Any = None) -> Any: |
| 222 | """Get value for a key with optional default. |
| 223 | |
| 224 | Args: |
| 225 | key: The key to look up. |
| 226 | default: Value to return if key not found (default: None). |
| 227 | |
| 228 | Returns: |
| 229 | The value associated with the key, or default if not found. |
| 230 | """ |
| 231 | node = self.root |
| 232 | while not node.is_leaf(): |
| 233 | node = node.get_child(key) |
| 234 | |
| 235 | value = node.get(key) |
| 236 | return value if value is not None else default |
| 237 | |
| 238 | def __contains__(self, key: Any) -> bool: |
| 239 | """Check if key exists (for 'in' operator)""" |
no test coverage detected