Serhiy Storchaka added the comment: Using lru_cache() is an implementation detail. I think that lru_cache wrapper should be perfect wrapper, it should support all protocols that are supported by wrapped function (at the same extent as original Python implementation).
Proposed simple patch adds support for pickling, copying and deep-copying lru_cache wrappers. lru_cache wrapper is serialized as global object, i.e. deepcopy() returns the same object, as was in 3.4. Implementing true deep copying (with any semantic) is not so easy, especially for Python implementation. ---------- keywords: +patch stage: -> patch review Added file: http://bugs.python.org/file40845/lru_cache_simple_pickling.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25447> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com