title: Store the cache to a file functools.lru_cache in Python >= 3.2
body: <p>I'm using <code>@functools.lru_cache</code> in Python 3.3. I would like to save the cache to a file, in order to restore it when the program will be restarted. How could I do?</p>
  
  <p><strong>Edit 1</strong> Possible solution: <a href="https://stackoverflow.com/questions/6234586/we-need-to-pickle-any-sort-of-callable">We need to pickle any sort of callable</a></p>
  
  <p>Problem pickling <code>__closure__</code>:</p>
  
  <pre><code>_pickle.PicklingError: Can't pickle &lt;class 'cell'&gt;: attribute lookup builtins.cell failed
  </code></pre>
  
  <p>If I try to restore the function without it, I get:</p>
  
  <pre><code>TypeError: arg 5 (closure) must be tuple
  </code></pre>