#11115: Rewrite cached_method in Cython
-------------------------------------+-------------------------------------
       Reporter:  SimonKing          |        Owner:  jason
           Type:  enhancement        |       Status:  closed
       Priority:  major              |    Milestone:  sage-5.0
      Component:  misc               |   Resolution:  fixed
       Keywords:  category cython    |    Merged in:  sage-5.0.beta0
  cache                              |    Reviewers:  Nicolas M. ThiƩry,
        Authors:  Simon King         |  Andrey Novoseltsev, Volker Braun
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
   Dependencies:  #9138, #11900      |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 Replying to [comment:179 jdemeyer]:
 > Could you please explain this line in `src/sage/misc/cachefunc.pxd`?
 > {{{
 > # cache is not always of type "dict"!
 > }}}

 That's why:
 {{{
 sage: from weakref import WeakValueDictionary
 sage: W = WeakValueDictionary()
 sage: isinstance(W, dict)
 False
 }}}
 We use weak value dictionaries for weak_cached_function.

 > It seems that the implementation assumes that `cache` is a `dict` anyway
 (I see lots of `<dict>self.cache` in the code).

 But certainly not in weak_cached_function.

--
Ticket URL: <http://trac.sagemath.org/ticket/11115#comment:180>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to