This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients BreamoreBoy, anacrolix, ezio.melotti, frafra, pitrou, rhettinger
Date 2014-07-19.14:50:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405781454.41.0.396516835712.issue17528@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2014-07-19 14:50:54pitrousetrecipients: + pitrou, rhettinger, ezio.melotti, frafra, anacrolix, BreamoreBoy
2014-07-19 14:50:54pitrousetmessageid: <1405781454.41.0.396516835712.issue17528@psf.upfronthosting.co.za>
2014-07-19 14:50:54pitroulinkissue17528 messages
2014-07-19 14:50:54pitroucreate