Thanks for all the work Simon. I think it makes more sense for Nicolas to review #11900, since he probably has already read most of the code. But I can review it if necessary. David
On Fri, Dec 9, 2011 at 04:58, David Roe <[email protected]> wrote: > Wow. There are a ton of comments on that patch. I will take a look > and see if I can review #11900. > David > > On Fri, Dec 9, 2011 at 04:17, Simon King <[email protected]> wrote: >> Hi David, >> >> On 9 Dez., 12:14, David Roe <[email protected]> wrote: >>> I'd like the following to work (in a Cython file): >>> >>> from sage.misc.cachefunc import cached_method >>> from sage.rings.arith import factor >>> cdef class A: >>> @cached_method >>> def expensive(self): >>> return factor(10^5000 + 41) >>> >>> Currently it fails since the type of a def method on a cython class is >>> <type 'builtin_function_or_method'>, and such methods have no >>> func_defaults attribute, which is used in sage.misc.function_mangling. >>> >>> How hard would it be to get cached_methods working for Cython files? >> >> Have a look at #11115 (which has a positive review but depends on >> #9138, which can only be merged when some regression is fixed, which >> is done in #11900, which needs review). >> >> You can not use arbitrary decorators in Cython. But you *can* use a >> cached methods in Cython files (not via decorators, I'm afraid) with >> #11115 - examples are provided there. >> >> Cheers, >> Simon >> >> -- >> To post to this group, send an email to [email protected] >> To unsubscribe from this group, send an email to >> [email protected] >> For more options, visit this group at >> http://groups.google.com/group/sage-devel >> URL: http://www.sagemath.org -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
