[issue19859] functools.lru_cache keeps objects alive forever

Serhiy Storchaka report at bugs.python.org
Tue Dec 3 21:30:04 CET 2013


Serhiy Storchaka added the comment:

Weak references make no sense in most cases when arguments disappear just after function call. For the self argument of a method it makes more sense. Perhaps lru_cache can return not a function, but a descriptor. This will allow implement special processing of first argument.

Or new decorator lru_cache_method should be added.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19859>
_______________________________________


More information about the Python-bugs-list mailing list