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
1 changed files with 4 additions and 1 deletions

View File

@ -197,6 +197,7 @@ def memoize(f):
@wraps(f)
def memf(*x, **kargs):
if x not in cache:
log.debug("adding to cache: %s", x)
cache[x] = f(*x, **kargs)
return cache[x]
return memf
@ -208,7 +209,9 @@ def combinations_with_replacement(iterable, r):
the implementation in this function as a
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)
n = len(pool)