Commit 02b10e7d authored by Guillaume Binet's avatar Guillaume Binet

New feature: default for storage context manager.

parent 5c19d29c
......@@ -45,8 +45,8 @@ class StoreMixin(MutableMapping):
return self._store.get(key)
@contextmanager
def mutable(self, key):
obj = self._store.get(key)
def mutable(self, key, default=None):
obj = self._store.get(key, default)
yield obj
# implements autosave for a plugin persistent entry
# with self['foo'] as f:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment