Mercurial > pylearn
changeset 1278:c9ec065ff736
cleanup in memo.py
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Tue, 14 Sep 2010 22:38:14 -0400 |
parents | bef6c5f565cd |
children | e198515bd4d4 |
files | pylearn/dataset_ops/memo.py |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/pylearn/dataset_ops/memo.py Tue Sep 14 22:37:00 2010 -0400 +++ b/pylearn/dataset_ops/memo.py Tue Sep 14 22:38:14 2010 -0400 @@ -9,9 +9,6 @@ def memo(f): #TODO: support kwargs to rval. This requires looking up the names of f's parameters to # construct a proper key. - - #TODO: use weak references instead of a normal dict so that the cache doesn't prevent - # garbage collection cache = {} def rval(*args): if args not in cache: @@ -24,5 +21,6 @@ rval.forget = forget rval.__name__ = 'memo@%s'%f.__name__ rval.cache = cache + rval.__doc__ = f.__doc__ return rval