For correctness, the __getattr__ method of DotNotationDict needs to raise an AttributeError when the attribute does not exist. Otherwise, you can't write getattr(my_dict, 'attr_does_not_exit', 100) (it'll raise KeyError, it won't return to you the default value).
For correctness, the
__getattr__
method ofDotNotationDict
needs to raise anAttributeError
when the attribute does not exist. Otherwise, you can't writegetattr(my_dict, 'attr_does_not_exit', 100)
(it'll raiseKeyError
, it won't return to you the default value).