How do you know what the user considers "small" and "large"? It depends on what the user is trying to do. The user can easily avoid caching by calling the .f attribute.
And if you really need to decide whether to cache or not based on the arguments, you have to manage your own cache. Using some condititonal that you can pass to the memoization decorator is a spectacularly ugly way of managing your own cache. For starters, it doesn't allow you to make the caching decision on intermediate values of your computation. On Thursday, May 15, 2014 10:06:34 AM UTC+1, Nathann Cohen wrote: > > > It is not. The problem is your 4 pages of if/else branches with > interspersed > > computations. All other problems that you are encountering are a > corollary > > of that one. > > How can you only cache the output of "small" values (the most used in any > recursion) and not the larger ones ? That's the use case mentionned by > Daniel, on this mailing-list. > And also by Jean-Baptiste on the trac ticket. > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.