changeset 866:9b13f7bb00ef

added cache member to memo-ized functions
author James Bergstra <bergstrj@iro.umontreal.ca>
date Tue, 10 Nov 2009 17:44:36 -0500
parents 49c1035fe582
children aaaed35c995e
files pylearn/dataset_ops/memo.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/dataset_ops/memo.py	Tue Nov 10 17:43:53 2009 -0500
+++ b/pylearn/dataset_ops/memo.py	Tue Nov 10 17:44:36 2009 -0500
@@ -20,6 +20,7 @@
     def forget():
         for k in cache.keys():
             del cache[k]
+    rval.cache = cache
     rval.forget = forget
     rval.__name__ = 'memo@%s'%f.__name__
     return rval