- Timestamp:
- 12/03/13 10:29:37 (2 years ago)
- Location:
- branches/decorate
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/decorate/memoize.py
r671 r709 3 3 """ 4 4 from functools import update_wrapper, wraps as functools_wraps 5 from mystic.math.rounding import deep_round, simple_round6 from mystic.cache.archives import archive_dict7 from mystic.cache.keymaps import stringmap8 from mystic.cacheimport inf_cache9 from mystic.cache._cache import _CacheInfo #XXX: expose _CacheInfo in cache ?5 from klepto.rounding import deep_round, simple_round 6 from klepto.archives import archive_dict 7 from klepto.keymaps import stringmap 8 from klepto import inf_cache 9 from klepto.tools import CacheInfo 10 10 11 11 __all__ = ['memoize', 'memoized'] … … 87 87 def info(): 88 88 """Report cache statistics""" 89 return _CacheInfo(stats[HIT], stats[MISS], stats[LOAD], self.__maxsize, len(self.__cache))89 return CacheInfo(stats[HIT], stats[MISS], stats[LOAD], self.__maxsize, len(self.__cache)) 90 90 91 91 # interface -
branches/decorate/surrogate.py
r669 r709 20 20 21 21 22 from mystic.cache.safe import inf_cache as memoized23 #from mystic.cacheimport inf_cache as memoized24 from mystic.cache.archives import archive_dict, file_archive25 from mystic.cache.keymaps import picklemap, stringmap, hashmap22 from klepto.safe import inf_cache as memoized 23 #from klepto import inf_cache as memoized 24 from klepto.archives import archive_dict, file_archive 25 from klepto.keymaps import picklemap, stringmap, hashmap 26 26 dumps = picklemap(flat=False) 27 27 encode = stringmap(flat=False) -
branches/decorate/test_cached.py
r671 r709 1 #from mystic.cache.safe import inf_cache as memoized2 1 #from mystic.cache import inf_cache as memoized 2 #from klepto.safe import inf_cache as memoized 3 3 from memoize import memoize as memoized 4 from mystic.cache.archives import file_archive 4 5 from klepto.archives import file_archive 5 6 from timer import timed 6 7
Note: See TracChangeset
for help on using the changeset viewer.