Radomir Dopieralski added the comment:

Thank you for your attention. I'm actually quite happy with the solution we 
have, it works well. That's actually I thought that it may be worthwhile to try 
and push it upstream to Python. I can totally understand why you don't want to 
add too much to the standard library, after all, everything you add there has 
to stay forever. So please consider this patch abandoned.

But I think it's would be still worthwhile to add a note to the lru_cache's 
documentation, saying something like:

"""
Warning! lru_cache will keep references to all the arguments for which it keeps 
cached values, which prevents them from being freed from memory when there are 
no other references. This can lead to memory leaks when you call a function 
with lru_cache on a lot of short-lived objects.
"""

I suppose you can come up with a nicer phrasing.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19859>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to