From 66c6dcf20309fda028cf77b912fa73229a02da0d Mon Sep 17 00:00:00 2001 From: pictuga Date: Sun, 1 Dec 2013 15:46:02 +0100 Subject: [PATCH] Store "as it" in JSON (int or str) The json lib does all the work --- morss.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/morss.py b/morss.py index 8c08c16..6cd1e87 100644 --- a/morss.py +++ b/morss.py @@ -151,17 +151,17 @@ class Cache: def __contains__(self, key): return key in self._cache or key in self._cached - def get(self, key, kind=str): + def get(self, key): if key in self._cache: - return kind(self._cache[key]) + return self._cache[key] elif key in self._cached: self._cache[key] = self._cached[key] - return kind(self._cached[key]) + return self._cached[key] else: return None def set(self, key, content): - self._cache[key] = str(content) or '' + self._cache[key] = content def save(self): if len(self._cache) == 0: