From 941e689c19165ebb5a8cc8308a6da84b4277d791 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sat, 21 Feb 2026 23:19:23 -0600 Subject: [PATCH] get_nested --- src/hooked_containers/common.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hooked_containers/common.py b/src/hooked_containers/common.py index 99bdc90..fd8883b 100644 --- a/src/hooked_containers/common.py +++ b/src/hooked_containers/common.py @@ -44,3 +44,12 @@ class HookedContainer(ABC, Sized, Iterable[T], Container[T]): @abstractmethod def insert(self, index, value): ... + + # Custom Methods + + def get_nested(self, keys): + """Recursively call __getitem__ with each key in the iterable.""" + result = self + for key in keys: + result = result[key] + return result