[Python] memoize to disk - Python - persistent memoization

Discussão em 'Python' iniciado por Stack, Dezembro 7, 2024.

  1. Stack

    Stack Membro Participativo

    Is there a way to memoize the output of a function to disk?

    I have a function

    def getHtmlOfUrl(url):
    ... # expensive computation


    and would like to do something like:

    def getHtmlMemoized(url) = memoizeToFile(getHtmlOfUrl, "file.dat")


    and then call getHtmlMemoized(url), to do the expensive computation only once for each url.

    Continue reading...

Compartilhe esta Página