Python 3.2 now includes memoization in the functools module. It's implemented in C, and using it is simple:
import functools
@functools.lru_cache()
def fib_lru_cache(n):
if n < 2:
return n
else:
return fib_lru_cache(n - 2) + fib_lru_cache(n - 1)
Consider replacing the memoization functions implemented in: idb/helpers/memoize.py with the new, standard lru_cache. Then, adjust the existing calls to memoized functions to use the new lru_cache.