1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-12-21 10:58:16 +00:00

Added shelve mixin

This commit is contained in:
J. Fernando Sánchez
2015-11-05 18:50:37 +01:00
parent bd2e0f0d5c
commit b8993f7d64
3 changed files with 77 additions and 1 deletions

View File

@@ -71,7 +71,10 @@ class Leaf(dict):
return id
def __delattr__(self, key):
return super(Leaf, self).__delitem__(self._get_key(key))
if key in self.__dict__:
del self.__dict__[key]
else:
super(Leaf, self).__delitem__(self._get_key(key))
def _get_key(self, key):
if key[0] == "_":