|
|
@ -7,6 +7,7 @@ import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HashableDict(dict):
|
|
|
|
class HashableDict(dict):
|
|
|
|
|
|
|
|
|
|
|
|
def __hash__(self):
|
|
|
|
def __hash__(self):
|
|
|
|
return hash(tuple(sorted(self.items())))
|
|
|
|
return hash(tuple(sorted(self.items())))
|
|
|
|
|
|
|
|
|
|
|
@ -25,7 +26,6 @@ def json_memoize(filename):
|
|
|
|
json.dump({}, f)
|
|
|
|
json.dump({}, f)
|
|
|
|
|
|
|
|
|
|
|
|
def __call__(self, *args, **kwargs):
|
|
|
|
def __call__(self, *args, **kwargs):
|
|
|
|
|
|
|
|
|
|
|
|
with open(filename, "r") as f:
|
|
|
|
with open(filename, "r") as f:
|
|
|
|
memo = json.load(f)
|
|
|
|
memo = json.load(f)
|
|
|
|
json_key = repr((self.fn.__name__, args, HashableDict(kwargs)))
|
|
|
|
json_key = repr((self.fn.__name__, args, HashableDict(kwargs)))
|
|
|
|