You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Python 3.2 now includes memoization in the functools module. It's implemented in C, and using it is simple:
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.
The text was updated successfully, but these errors were encountered: