From 8bc74489614407a4b3c318ef60bd8b6b8fcd6cbb Mon Sep 17 00:00:00 2001 From: Baudouin Raoult Date: Fri, 26 Apr 2024 10:26:15 +0100 Subject: [PATCH] better error message --- anemoi/utils/config.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/anemoi/utils/config.py b/anemoi/utils/config.py index 8c85aaa..7871a63 100644 --- a/anemoi/utils/config.py +++ b/anemoi/utils/config.py @@ -19,7 +19,17 @@ class DotDict(dict): - """A dictionary that allows access to its keys as attributes""" + """A dictionary that allows access to its keys as attributes. + + >>> d = DotDict({"a": 1, "b": {"c": 2}}) + >>> d.a + 1 + >>> d.b.c + 2 + >>> d.b = 3 + >>> d.b + 3 + """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs)