Commit f41f9134 authored by juga's avatar juga
Browse files

Implement get method in State

parent cf4fe8a1
......@@ -63,6 +63,13 @@ class State:
self._state = self._read()
return self._state.__len__()
def get(self, key):
if not isinstance(key, str):
raise TypeError(
'Keys must be strings. %s is a %s' % (key, type(key)))
self._state = self._read()
return self._state.get(key)
def __getitem__(self, key):
if not isinstance(key, str):
raise TypeError(
......
Supports Markdown
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