diff --git a/json_memoize.py b/json_memoize.py index 1101516..683a137 100644 --- a/json_memoize.py +++ b/json_memoize.py @@ -13,7 +13,7 @@ class HashableDict(dict): def json_memoize(filename): - """Return a decorator that memoizes function calls in a JSON file.""" + """A decorator that memoizes function calls in a JSON file.""" class JsonMemoize: @@ -78,11 +78,13 @@ def is_prime(n): @json_memoize('json_memoize_tmp.json') def multiply(*args): + """Multiply all args.""" return reduce(operator.mul, args, 1) @json_memoize('json_memoize_tmp.json') def some_with_kwargs(one, two, **kwargs): + """Add 'one' and 'two' and all the values of the keyword arguments.""" return one + two + reduce(operator.add, [kwargs[k] for k in kwargs], 0)