From 7618c46226748ad1249f2ef5910af085160bbec4 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 7 Nov 2022 17:57:19 -0800 Subject: [PATCH] Add dotdict delattr. --- voussoirkit/dotdict.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/voussoirkit/dotdict.py b/voussoirkit/dotdict.py index 0f2535b..1d18213 100644 --- a/voussoirkit/dotdict.py +++ b/voussoirkit/dotdict.py @@ -14,6 +14,9 @@ class DotDict: self.__dict__.update(__dict) self.__dict__.update(**kwargs) + def __delattr__(self, key): + self.__dict__.pop(key, None) + def __getattr__(self, key): try: return self.__dict__[key]