Back
Close

Journey to Master Python (WIP)

ageekymonk
16K views

Functools module

Memoization

Functools module supports memoization through lru_cache decorator. This way you dont need to write memoization code.

In the example adding the decorator @lru_cache does the needful. You can also see the cache details with cache_info

lru_cache Decorator
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants