Memoize на диск — python — постоянное запоминаниеPython

Программы на Python
Гость
Memoize на диск — python — постоянное запоминание

Сообщение Гость »


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), so as to do the expensive computation only once for each url.


Источник: https://stackoverflow.com/questions/164 ... emoization

Вернуться в «Python»