Author thesheep
Recipients ncoghlan, rhettinger, serhiy.storchaka, thesheep
Date 2013-12-03.23:57:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Actually, after looking closer, my @memoize_method decorator does something completely different than Serhiy suggested. Still it only solves the common case of methods, and does nothing if you pass your short-lived objects as other parameters than self.

Limiting the cache size is also not a solution in the practical example with request that I linked to in the previous comment, because we can't know in advance how many times per request the function is going to be called, picking an arbitrary number feels wrong and may lead to unexpected behaviors when other fragments of code change (like a sudden slowdown every N calls).
Date User Action Args
2013-12-03 23:57:43thesheepsetrecipients: + thesheep, rhettinger, ncoghlan, serhiy.storchaka
2013-12-03 23:57:43thesheepsetmessageid: <>
2013-12-03 23:57:43thesheeplinkissue19859 messages
2013-12-03 23:57:43thesheepcreate