diff --git a/scone/head/variables.py b/scone/head/variables.py index 9e29911..d36cdf6 100644 --- a/scone/head/variables.py +++ b/scone/head/variables.py @@ -113,9 +113,13 @@ class Variables: keys = name.split(".") try: for k in keys: - if not isinstance(current, dict): - raise ValueError(f"non-dictionary encountered when getting {name}") - current = current[k] + if isinstance(current, dict): + current = current[k] + elif isinstance(current, list): + current = current[int(k)] + else: + raise ValueError(f"non-dictionary, non-list encountered when getting {name}") + return current except KeyError: if self._delegate: