Add dotdict delattr.
This commit is contained in:
parent
c838a9758a
commit
7618c46226
1 changed files with 3 additions and 0 deletions
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue