This is not supported directly.
However, you can achieve the desired behavior using the built-in OmegaConf resolvers oc.dict.*.
Those resolvers allow you to access the keys or values of a config node as a list:
cfg = OmegaConf.create(
{
"workers": {
"node3": "10.0.0.2",
"node7": "10.0.0.9",
},
"nodes": "${oc.dict.keys: workers}",
"ips": "${oc.dict.values: workers}",
}
)
# Keys are copied from the DictConfig:
show(cfg.nodes)
# -> type: ListConfig, value: ['node3', 'node7']
# Values are dynamically fetched through interpolations:
show(cfg.ips)
# -> type: ListConfig, value: ['${workers.node3}', '${workers.node7}']
assert cfg.ips == ["10.0.0.2", "10.0.0.9"]
With this, you can compose a dictionary and have a node that access the values or keys as if they are a list.