Get the config by id. Args: id: id to specify the expected position. See also :py:meth:`__getitem__`. default: default value to return if the specified ``id`` is invalid.
(self, id: str = "", default: Any | None = None)
| 396 | return |
| 397 | |
| 398 | def get(self, id: str = "", default: Any | None = None) -> Any: |
| 399 | """ |
| 400 | Get the config by id. |
| 401 | |
| 402 | Args: |
| 403 | id: id to specify the expected position. See also :py:meth:`__getitem__`. |
| 404 | default: default value to return if the specified ``id`` is invalid. |
| 405 | |
| 406 | """ |
| 407 | try: |
| 408 | return self[id] |
| 409 | except (KeyError, IndexError, ValueError): # Index error for integer indexing |
| 410 | return default |
| 411 | |
| 412 | def set(self, config: Any, id: str = "", recursive: bool = True) -> None: |
| 413 | """ |
no outgoing calls