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 thesheep
Recipients ncoghlan, rhettinger, serhiy.storchaka, thesheep
Date 2013-12-04.10:15:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386152120.21.0.486045339018.issue19859@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-12-04 10:15:20thesheepsetrecipients: + thesheep, rhettinger, ncoghlan, serhiy.storchaka
2013-12-04 10:15:20thesheepsetmessageid: <1386152120.21.0.486045339018.issue19859@psf.upfronthosting.co.za>
2013-12-04 10:15:20thesheeplinkissue19859 messages
2013-12-04 10:15:19thesheepcreate