|
@@ -55,20 +55,19 @@ controllers = {} |
|
|
class _dict(dict): |
|
|
class _dict(dict): |
|
|
"""dict like object that exposes keys as attributes""" |
|
|
"""dict like object that exposes keys as attributes""" |
|
|
|
|
|
|
|
|
|
|
|
__slots__ = () |
|
|
__getattr__ = dict.get |
|
|
__getattr__ = dict.get |
|
|
__setattr__ = dict.__setitem__ |
|
|
__setattr__ = dict.__setitem__ |
|
|
__delattr__ = dict.__delitem__ |
|
|
__delattr__ = dict.__delitem__ |
|
|
|
|
|
__setstate__ = dict.update |
|
|
|
|
|
|
|
|
def __getstate__(self): |
|
|
def __getstate__(self): |
|
|
return self |
|
|
return self |
|
|
|
|
|
|
|
|
def __setstate__(self, d): |
|
|
|
|
|
self.update(d) |
|
|
|
|
|
|
|
|
|
|
|
def update(self, d): |
|
|
|
|
|
|
|
|
def update(self, *args, **kwargs): |
|
|
"""update and return self -- the missing dict feature in python""" |
|
|
"""update and return self -- the missing dict feature in python""" |
|
|
|
|
|
|
|
|
super().update(d) |
|
|
|
|
|
|
|
|
super().update(*args, **kwargs) |
|
|
return self |
|
|
return self |
|
|
|
|
|
|
|
|
def copy(self): |
|
|
def copy(self): |
|
|