Add dotdict delattr.

This commit is contained in:
voussoir 2022-11-07 17:57:19 -08:00
parent c838a9758a
commit 7618c46226
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -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]