Skip to content

Commit

Permalink
Fix memoize to include more data to make deviceClasses unique...
Browse files Browse the repository at this point in the history
  • Loading branch information
eedgar committed Aug 27, 2013
1 parent b41e398 commit 210659d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zpg/memoize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 210659d

Please sign in to comment.