added a log for proof of cache

This commit is contained in:
Stephen McQuay 2011-05-04 21:25:16 -06:00
parent 2e7391f573
commit 09fc14b99d

View File

@ -197,6 +197,7 @@ def memoize(f):
@wraps(f) @wraps(f)
def memf(*x, **kargs): def memf(*x, **kargs):
if x not in cache: if x not in cache:
log.debug("adding to cache: %s", x)
cache[x] = f(*x, **kargs) cache[x] = f(*x, **kargs)
return cache[x] return cache[x]
return memf return memf
@ -208,7 +209,9 @@ def combinations_with_replacement(iterable, r):
the implementation in this function as a the implementation in this function as a
replacement. replacement.
see: http://docs.python.org/library/itertools.html#itertools.combinations_with_replacement source:
http://docs.python.org/library/itertools.html#itertools.combinations_with_replacement
""" """
pool = tuple(iterable) pool = tuple(iterable)
n = len(pool) n = len(pool)