Jason Merrill wrote:
> On Sep 9, 6:35 pm, Justin Walker <[EMAIL PROTECTED]> wrote:
>> Hi, all,
>>
> There may be a more pythonic way to do this--I'm just trying to
> translate something I saw in Ruby.  I think I've seen at least one
> person define an @cache decorator somewhere on the web.

I believe we have such a decorator already in Sage, courtesy of mhansen, 
and of all people, the original poster :).

I don't know if it works they way describe, though, since it caches the 
output of a function by looking up the arguments.  In the case where 
there are no arguments, like you point out, you could just replace the 
function.

See sage.misc.cachefunc?? for details.

-Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to