diff --git a/chanfig/registry.py b/chanfig/registry.py index 1d76341b..7f30c5d8 100644 --- a/chanfig/registry.py +++ b/chanfig/registry.py @@ -201,7 +201,10 @@ def lookup(self, name: str, default: Any = Null) -> Any: if default is Null: default = self.getattr("default", Null) - return self.get(name, default) + element = self.get(name, default) + if isinstance(element, Registry): + return element.getattr("default") + return element @staticmethod def init(cls: Callable, *args: Any, **kwargs: Any) -> Any: # pylint: disable=W0211