By using this site, you agree to this use. See details.
Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
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