(
self,
key: Key,
*,
access_lists: bool = True,
)
| 269 | self.dict: dict[str, Any] = {} |
| 270 | |
| 271 | def get_or_create_nest( |
| 272 | self, |
| 273 | key: Key, |
| 274 | *, |
| 275 | access_lists: bool = True, |
| 276 | ) -> dict[str, Any]: |
| 277 | cont: Any = self.dict |
| 278 | for k in key: |
| 279 | if k not in cont: |
| 280 | cont[k] = {} |
| 281 | cont = cont[k] |
| 282 | if access_lists and isinstance(cont, list): |
| 283 | cont = cont[-1] |
| 284 | if not isinstance(cont, dict): |
| 285 | raise KeyError("There is no nest behind this key") |
| 286 | return cont # type: ignore[no-any-return] |
| 287 | |
| 288 | def append_nest_to_list(self, key: Key) -> None: |
| 289 | cont = self.get_or_create_nest(key[:-1]) |
no outgoing calls
no test coverage detected