Antoine Pitrou added the comment: That doesn't sound like a good idea. lru_cache is a decorator, that acts as transparently as possible (i.e. the decorated function has the same metadata and appearance as the original function). Therefore, the lru_cache'd function should also pickle as a regular function - which it currently does.
Having a pickle carry all the cache overhead would actually be a regression - instead of a couple of bytes representing the function's global name, you could now get kilobytes (or more) of data representing the whole cache contents. (and, also, it would fail if the cache contains any non-picklable data) ---------- nosy: +pitrou _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17528> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com