Open axiomcura opened 1 year ago
According to functools documentation implementing lru_cache on function memorizes the output generated.
functools
lru_cache
This means any recursive searches will not be executed again if the output is cached.
It is very simple to implement. Here's an example below:
def test(input: str) -> str: # code below
from functools import rlu_cache @rlu_cache def test(input: str) -> str: #code below
To implement only requires a decorator.
According to
functools
documentation implementinglru_cache
on function memorizes the output generated.This means any recursive searches will not be executed again if the output is cached.
It is very simple to implement. Here's an example below:
To implement only requires a decorator.