From 210659d8edd597778ab4f4ffd09b6fa5466c7054 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Tue, 27 Aug 2013 09:55:57 -0700 Subject: [PATCH] Fix memoize to include more data to make deviceClasses unique... --- zpg/memoize.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zpg/memoize.py b/zpg/memoize.py index f6ffab2..0abc256 100644 --- a/zpg/memoize.py +++ b/zpg/memoize.py @@ -38,8 +38,11 @@ def __call__(self, *args, **kw): cache = obj.__cache except AttributeError: cache = obj.__cache = {} - key = (self.func, args[1:]) - + kwitems = [item + for item in kw.items() if isinstance(item[1], + basestring)] + key = (self.func, args[1:], str(frozenset(kwitems))) + #key = (self.func, args[1:]) try: res = cache[key] # print "Using Memoized %s = %s" % (key,res)